Just sending seconds counter to the serial port

Dependencies:   mbed

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

/media/uploads/Ksenia/terminal.png

main.cpp

Committer:
Ksenia
Date:
2016-09-12
Revision:
0:d61b39a672e1

File content as of revision 0:d61b39a672e1:

#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) {}
}