Just sending seconds counter to the serial port

Dependencies:   mbed

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

/media/uploads/Ksenia/terminal.png

Revision:
0:d61b39a672e1
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