Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: timed_switch.h
- Revision:
- 0:5d9b6304f982
- Child:
- 1:a523eaac3b7c
--- /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