Expand basic example in readme

This commit is contained in:
Ben Nuttall
2015-11-16 12:41:47 +00:00
parent f1299037b5
commit 213dc4b32b

View File

@@ -15,10 +15,25 @@ The latest release is 1.0 released on 16th November 2015.
About About
===== =====
With very little code, you can quickly get going connecting your physical Component interfaces are provided to allow a frictionless way to get started
components together:: with physical computing::
from gpiozero import LED
from time import sleep
led = LED(2)
while True:
led.on()
sleep(1)
led.off()
sleep(1)
With very little code, you can quickly get going connecting your components
together::
from gpiozero import LED, Button from gpiozero import LED, Button
from signal import pause
led = LED(2) led = LED(2)
button = Button(3) button = Button(3)
@@ -26,6 +41,8 @@ components together::
button.when_pressed = led.on button.when_pressed = led.on
button.when_released = led.off button.when_released = led.off
pause()
The library includes interfaces to many simple everyday components, as well as The library includes interfaces to many simple everyday components, as well as
some more complex things like sensors, analogue-to-digital converters, full some more complex things like sensors, analogue-to-digital converters, full
colour LEDs, robotics kits and more. colour LEDs, robotics kits and more.