Ksenia Kondrashova
/
Start_program_for_habr
Just sending seconds counter to the serial port
Embed:
(wiki syntax)
Show/hide line numbers
main.cpp
00001 #include "mbed.h" 00002 00003 Serial pc(USBTX, USBRX); 00004 Ticker timeKeeping; 00005 00006 volatile uint64_t seconds = 0; 00007 00008 void secondsCallback(void) { 00009 pc.printf("Number of seconds: %x\r\n", seconds); 00010 seconds ++; 00011 } 00012 00013 int main() { 00014 timeKeeping.attach(&secondsCallback, 1.0f); 00015 while(1) {} 00016 }
Generated on Tue Jul 19 2022 22:11:05 by 1.7.2