Sakis Kasampalis / Mbed 2 deprecated timed-switch

Dependencies:   mbed

Revision:
0:5d9b6304f982
Child:
1:a523eaac3b7c
diff -r 000000000000 -r 5d9b6304f982 timed_switch.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/timed_switch.h	Sat Feb 11 18:39:32 2012 +0000
@@ -0,0 +1,18 @@
+#ifndef TIMED_SWITCH_H
+#define TIMED_SWITCH_H
+
+enum {LedOff = 0, LedOn = 1};
+enum {False, True};
+
+const float wait_time = 0.2;    // to avoid bouncing
+const float wait_on = 0.5;
+const float wait_off = 0.5;
+const unsigned short time_correction = wait_time * 1000; // correction in msec.
+
+Timer t;                        // for tracking time
+unsigned int button_holded;     // for tracking how long was the button holded
+
+DigitalIn button (p19);
+DigitalOut myled (LED3);
+
+#endif