Sverre Didrichsen
/
oving4-301
Martin
main.cpp
- Committer:
- mdidrich
- Date:
- 2017-09-20
- Revision:
- 0:17fa7348796d
File content as of revision 0:17fa7348796d:
#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; } } }