@@ -32,7 +32,7 @@ the header pin number and whether the pin is to be used for input or
3232output.
3333
3434 out_pin = Pin(12, Pin.Out)
35- in_pin = Pin(16 , Pin.In)
35+ in_pin = Pin(11 , Pin.In)
3636
3737When you have a Pin instance you can read or write its value. A value
3838of 1 is high, a value of 0 is low.
@@ -50,7 +50,7 @@ Putting it all together into a single program:
5050 from quick2wire.gpio import Pin
5151
5252 out_pin = Pin(12, Pin.Out)
53- in_pin = Pin(16 , Pin.In)
53+ in_pin = Pin(11 , Pin.In)
5454
5555 out_pin.value = 1
5656 print(in_pin.value)
@@ -64,34 +64,20 @@ as part of a [with](http://docs.python.org/reference/compound_stmts.html#with) s
6464
6565 from quick2wire.gpio import Pin, exported
6666
67- with exported(Pin(12, Pin.Out)) as out_pin, exported(Pin(16 , Pin.In)) as in_pin:
67+ with exported(Pin(12, Pin.Out)) as out_pin, exported(Pin(11 , Pin.In)) as in_pin:
6868 out_pin.value = 1
6969 print(in_pin.value)
7070
7171This will unexport the pins when the program leaves the ` with ` statement, even
7272if the user kills the program or a bad piece of code throws an exception.
7373
74- Here's a slightly more complicated example that blinks an LED attached to pin 8 . This will
74+ Here's a slightly more complicated example that blinks an LED attached to pin 12 . This will
7575loop forever until the user stops it with a Control-C.
7676
7777 from time import sleep
7878 from quick2wire.gpio import Pin, exported
7979
80- with exported(Pin(8 , Pin.Out)) as pin:
80+ with exported(Pin(12 , Pin.Out)) as pin:
8181 while True:
8282 pin.value = 1 - pin.value
8383 sleep(1)
84-
85-
86- Connecting Pins
87- ---------------
88-
89- To make this blink program work, you'll need to know which physical pins to connect. The
90- ` quick2wire.gpio ` library sorts out the confusion of pin numbering schemes so that you can
91- just specify the physical pin on the device. [ This page] ( http://elinux.org/Rpi_Low-level_peripherals )
92- currently seems to be the best summary of the pins and the I/O roles they fulfill. The library
93- will allow you to allocate only those pins which support GPIO. Lower numbered
94- pins are at the top end of the Pi with the SD Card and power connector. Pins 1 and 2 (at the top of
95- the columns) are the 3.3 and 5 volt outputs. Here's a Pi wired up for the blink program
96-
97- <img src =" http://github.com/quick2wire/quick2wire-python-api/raw/master/doc/getting-started-with-gpio-setup.png " alt =" GPIO wiring example " width =" 250 " />
0 commit comments