Just sending seconds counter to the serial port

Dependencies:   mbed

Проект для статьи "Как перестать бояться и полюбить mbed. [Часть 1]" См. https://habrahabr.ru/company/efo/blog/308440/

/media/uploads/Ksenia/terminal.png

Files at this revision

API Documentation at this revision

Comitter:
Ksenia
Date:
Mon Sep 12 12:12:15 2016 +0000
Commit message:
initial commit

Changed in this revision

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 d61b39a672e1 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon Sep 12 12:12:15 2016 +0000
@@ -0,0 +1,16 @@
+#include "mbed.h"
+ 
+Serial              pc(USBTX, USBRX);
+Ticker              timeKeeping;
+
+volatile uint64_t   seconds = 0;
+
+void secondsCallback(void) {
+    pc.printf("Number of seconds: %x\r\n", seconds);
+    seconds ++;
+}
+ 
+int main() {
+    timeKeeping.attach(&secondsCallback, 1.0f);
+    while(1) {}
+}
\ No newline at end of file
diff -r 000000000000 -r d61b39a672e1 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Mon Sep 12 12:12:15 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/2241e3a39974
\ No newline at end of file