more backups
[rb-clock.git] / python / sw.py
diff --git a/python/sw.py b/python/sw.py
new file mode 100644 (file)
index 0000000..6c8d9a0
--- /dev/null
@@ -0,0 +1,11 @@
+import gaugette.gpio
+import gaugette.switch
+SW_PIN = 13
+gpio = gaugette.gpio.GPIO()
+sw = gaugette.switch.Switch(gpio, SW_PIN)
+last_state = sw.get_state()
+while True:
+  state = sw.get_state()
+  if state != last_state:
+    print "switch %d" % state
+    last_state = state