Sverre Didrichsen
/
oving4-301
Martin
Revision 0:17fa7348796d, committed 2017-09-20
- Comitter:
- mdidrich
- Date:
- Wed Sep 20 05:50:40 2017 +0000
- Commit message:
- Martin
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 |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Wed Sep 20 05:50:40 2017 +0000 @@ -0,0 +1,26 @@ +#include "mbed.h" + +BusOut led(LED1, LED2, LED3, LED4); + +Ticker myTick; +volatile int countUp = 0; + +void count() +{ + if(countUp < 16) { + countUp++; + } +} +int main() +{ + + myTick.attach(&count, 2); + while(1) { + led = countUp; + + if(countUp > 16) { + myTick.detach(); + countUp = 0; + } + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Wed Sep 20 05:50:40 2017 +0000 @@ -0,0 +1,1 @@ +https://mbed.org/users/mbed_official/code/mbed/builds/675da3299148 \ No newline at end of file