from intel_board import IntelBoard ib = IntelBoard.from_file('board_layout.json') while ib.loop(): if ib.light_sensor > 40: ib.notify_once("light", "on") else: ib.notify_once("light", "off")
"name": "green_led", "pin": "D2" }, { "type": "led", "name": "red_led", "pin": "D4" }, { "type": "led", "name": "blue_led", "pin": "D3" } ] } ''' ib = IntelBoard.from_file(board_layout) def cleanup(a, b): ib.green_led = False ib.blue_led = False ib.red_led = False ib.buzzer = 0 sys.exit(0) signal.signal(signal.SIGINT, cleanup) print "****** Fire Alarm ******" # init ib.buzzer = 0 while True:
from intel_board import IntelBoard ib = IntelBoard() ib.notify_once("robbed")