more backups
[rb-clock.git] / python / sw.py
1 import gaugette.gpio
2 import gaugette.switch
3 SW_PIN = 13
4 gpio = gaugette.gpio.GPIO()
5 sw = gaugette.switch.Switch(gpio, SW_PIN)
6 last_state = sw.get_state()
7 while True:
8   state = sw.get_state()
9   if state != last_state:
10     print "switch %d" % state
11     last_state = state