1
0
mirror of https://github.com/xtacocorex/CHIP_IO synced 2025-07-20 04:43:21 +00:00

pull up/down feature addition to close #48. fixed gpio cleanup() function again, 3rd time is a charm. version bump to 0.3.4

This commit is contained in:
Robert Wolterman
2017-01-29 03:50:37 +00:00
parent a839661c3b
commit 2b23e2d165
10 changed files with 285 additions and 79 deletions

View File

@ -191,6 +191,15 @@ Inputs work similarly to outputs.::
import CHIP_IO.GPIO as GPIO
GPIO.setup("CSID0", GPIO.IN)
Other options when setting up pins::
# Specify pull up/pull down settings on a pin
GPIO.setup("CSID0", GPIO.IN, pull_up_down=GPIO.PUD_UP)
# Specify initial value for an output
GPIO.setup("CSID0", GPIO.OUT, initial=1)
Pull Up/Down values are only for pins that are provided by the R8, the XIO are not capable of this. The allowable values are: PUD_OFF, PUD_UP, and PUD_DOWN.
Polling inputs::
if GPIO.input("CSID0"):