![](/media/cache/profiles/916954106a13204fa4909ae2d48e0602.jpg.50x50_q85.jpg)
aaaaaaaaa
Diff: main.cpp
- Revision:
- 0:6679ec22f0e5
diff -r 000000000000 -r 6679ec22f0e5 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sun Nov 10 23:19:38 2019 +0000 @@ -0,0 +1,26 @@ +#include "mbed.h" +#include "songs.h" +#include "player.h" + +Ticker ticker; +DigitalOut out(D13); +DigitalOut timeout(D12); + +void play_isr() { + timeout = 1; + if(play()) out = 1; + else out = 0; + timeout = 0; +} + +int main() { + // Init the ticker with the address of the function (toggle_led) to be attached and the interval (100 ms) + + song = (Note*) mario2; + songLength = sizeof(mario2) / 4; + initialize_play(); + ticker.attach_us(&play_isr, 20); + while (true) { + // Do other things... + } +} \ No newline at end of file