Luuk Blaauw
/
Assignment3_Ticker
Ticker
Revision 0:d483fc2ef3b7, committed 2016-09-15
- Comitter:
- luukblaauw
- Date:
- Thu Sep 15 14:59:45 2016 +0000
- Commit message:
- Ticker
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/MODSERIAL.lib Thu Sep 15 14:59:45 2016 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/Sissors/code/MODSERIAL/#4737f8a5b018
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Sep 15 14:59:45 2016 +0000 @@ -0,0 +1,24 @@ +#include "mbed.h" +#include "MODSERIAL.h" +Ticker tiktak; +DigitalOut led(LED_RED); +MODSERIAL pc(USBTX, USBRX); + +volatile int n_5sec_passed = 0; + +void TrackTime() +{ + n_5sec_passed++; + } + + +int main() +{ + tiktak.attach(&TrackTime,5); + pc.baud(9600); + while (true) { + led = !led; // toggle led + wait(0.2f); + pc.printf("%i maal 5 seconde geweest.\r\n",n_5sec_passed); + } +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Sep 15 14:59:45 2016 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/2e9cc70d1897 \ No newline at end of file