11.3

Dependencies:   TextLCD mbed

Files at this revision

API Documentation at this revision

Comitter:
Zvonimir_Belic
Date:
Thu Nov 24 19:04:12 2016 +0000
Commit message:
VT4_Beli?_Zvonimir

Changed in this revision

TextLCD.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r ed1071ad2950 TextLCD.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/TextLCD.lib	Thu Nov 24 19:04:12 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/simon/code/TextLCD/#308d188a2d3a
diff -r 000000000000 -r ed1071ad2950 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Nov 24 19:04:12 2016 +0000
@@ -0,0 +1,19 @@
+#include "mbed.h"
+InterruptIn button(p30); // Interrupt on digital input p30
+DigitalOut led1(LED1); // digital out to onboard LED1
+Timer debounce; // define debounce timer
+LocalFileSystem local("local"); // define local file system
+void toggle(void); // function prototype
+int main() {
+debounce.start(); // start debounce timer
+button.rise(&toggle); // attach the toggle function to the rising edge
+}
+void toggle() { // perform toggle if debounce time has elapsed
+if (debounce.read_ms()>200) {
+led1=!led1; // toggle LED
+FILE* Logfile = fopen ("/local/log.txt","a"); // open file for appending
+fprintf(Logfile,"time=%.3fs: setting led=%d\n\r",debounce.read(),led1.read());
+fclose(Logfile); // close file
+debounce.reset(); // reset debounce timer
+}
+}
\ No newline at end of file
diff -r 000000000000 -r ed1071ad2950 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Nov 24 19:04:12 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/d75b3fe1f5cb
\ No newline at end of file