Hi,
I'm trying to reproduce this sample python script with Malos and protobuffer, but I can't read the value of GPIO 16 in the updateSocket.on('message'.
Here the python code:
`import RPi.GPIO as GPIO
from time import sleep
def my_callback(channel):
if GPIO.input(16): # Pin 16
print "Rising"
if name == "main":
GPIO.setmode(GPIO.BCM)
GPIO.setup(16, GPIO.IN)
GPIO.add_event_detect(16, GPIO.RISING, callback=my_callback, bouncetime=400)
Hi, I'm trying to reproduce this sample python script with Malos and protobuffer, but I can't read the value of GPIO 16 in the updateSocket.on('message'.
Here the python code:
`import RPi.GPIO as GPIO from time import sleep
def my_callback(channel): if GPIO.input(16): # Pin 16 print "Rising"
if name == "main": GPIO.setmode(GPIO.BCM) GPIO.setup(16, GPIO.IN) GPIO.add_event_detect(16, GPIO.RISING, callback=my_callback, bouncetime=400)
My basic idea is to use the IR sensor as a trigger button, like in alexa demo.
Any suggestion?
[Update] Sorry. Really bad question. There are lot of node modules like RPi.GPIO library, (e.g. onoff).
I have some problem with noise on pin 16 and I'm trying to find the right workaround.