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

cleanup of brettcvz's read_byte function, added read_word since he really needs 12 bits of data. finally fixed the gpio cleanup() without argument issue once and for all, sorry for lying howientc

This commit is contained in:
Robert Wolterman
2017-01-29 22:58:41 +00:00
parent 6beacbb382
commit cd85e2b5eb
8 changed files with 130 additions and 41 deletions

View File

@ -205,6 +205,15 @@ Polling inputs::
else:
print("LOW")
Read lots of data::
# Get 8 bits of data in one shot
mybyte = GPIO.read_byte("LCD-D3")
# Get 16 bits of data in one shot
myword = GPIO.read_word("XIO-P4")
This code was initially added by brettcvz and I cleaned it up and expanded it.
The edge detection code below only works for the AP-EINT1, AP-EINT3, and XPO Pins on the CHIP.
Waiting for an edge (GPIO.RISING, GPIO.FALLING, or GPIO.BOTH::