Skip to content

Instantly share code, notes, and snippets.

@felipefdl
Last active August 29, 2015 14:16
Show Gist options
  • Save felipefdl/857482c7911898fd80aa to your computer and use it in GitHub Desktop.
Save felipefdl/857482c7911898fd80aa to your computer and use it in GitHub Desktop.
from tago import Tago
import RPi.GPIO as GPIO
my_device = Tago('a59d8000-80c6-11e4-95c1-295f66956ea3').device
GPIO.setmode(GPIO.BCM)
GPIO.setup(4, GPIO.OUT)
def func_callback_data(data):
if data['value'] == True:
GPIO.output(4, True)
else:
GPIO.output(4, False)
my_device.listening(func_callback_data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment