Thursday, October 15, 2015

GPIO Zero - a simple interface to GPIO for Raspberry Pi

GPIO Zero is a simple interface to everyday GPIO components used with Raspberry Pi, with very little code, you can quickly get going connecting your physical components together.

This video show my first try of GPIO Zero on raspberry Pi 2/Raspbian Jessie.

Connection (LED and Button):
Run IDLE with sudo, enter the simple code to test:
Python 2.7.9 (default, Mar  8 2015, 00:52:26) 
[GCC 4.9.2] on linux2
Type "copyright", "credits" or "license()" for more information.
>>> from gpiozero import LED, Button
>>> led=LED(2)
>>> button=Button(3)
>>> button.when_pressed=led.on

No comments: