From 213dc4b32b296a810f92eda3daff6c8eebdcf134 Mon Sep 17 00:00:00 2001 From: Ben Nuttall Date: Mon, 16 Nov 2015 12:41:47 +0000 Subject: [PATCH] Expand basic example in readme --- README.rst | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index 383516e..4b8fd21 100644 --- a/README.rst +++ b/README.rst @@ -15,10 +15,25 @@ The latest release is 1.0 released on 16th November 2015. About ===== -With very little code, you can quickly get going connecting your physical -components together:: +Component interfaces are provided to allow a frictionless way to get started +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 signal import pause led = LED(2) button = Button(3) @@ -26,6 +41,8 @@ components together:: button.when_pressed = led.on button.when_released = led.off + pause() + The library includes interfaces to many simple everyday components, as well as some more complex things like sensors, analogue-to-digital converters, full colour LEDs, robotics kits and more.