Hi guys!
import RPIO
def do_something(gpio_id, value):
print("New value for GPIO %s: %s" % (gpio_id, value))
RPIO.add_interrupt_callback(17, do_something, edge='rising')
RPIO.add_interrupt_callback(18, do_something, edge='falling')
RPIO.add_interrupt_callback(19, do_something, edge='both', threaded_callback=True)
RPIO.wait_for_interrupts()import RPIO
# set up GPIO output channel
RPIO.setup(17, RPIO.OUT)
# set gpio 17 to high
RPIO.output(17, RPIO.HIGH)
# set up output channel with an initial state
RPIO.setup(18, RPIO.OUT, initial=RPIO.LOW)
# set up input channel with pull-up control
# (pull_up_down be PUD_OFF, PUD_UP or PUD_DOWN, default PUD_OFF)
RPIO.setup(19, RPIO.IN, pull_up_down=RPIO.PUD_UP)
# read input from gpio 19
input_value = RPIO.input(19)
# to change to BOARD GPIO numbering
RPIO.setmode(RPIO.BOARD)
# to reset every channel that has been set up by this program to INPUT with no pullup/pulldown and no event detection
RPIO.cleanup()sudo pip install RPIO