avnish aggarwal
/
Book-PE_09-10_Metronomex
ok
Fork of Book-PE_09-10_Metronome by
Diff: main.cpp
- Revision:
- 1:733a0de4d34c
- Parent:
- 0:d7c850cdbc39
diff -r d7c850cdbc39 -r 733a0de4d34c main.cpp --- a/main.cpp Fri May 24 21:49:35 2013 +0000 +++ b/main.cpp Thu Aug 01 23:24:00 2013 +0000 @@ -1,15 +1,18 @@ /*Program Example 9.10: Metronome. Uses Ticker to set beat rate - */ + + +//BusIn joy(p15,p12,p13,p16); + */ #include "mbed.h" #include <stdio.h> Serial pc(USBTX, USBRX); -DigitalIn up_button(p5); -DigitalIn down_button(p6); -DigitalOut redled(p19); //displays the metronome beat +DigitalIn up_button(p15); +DigitalIn down_button(p16); +DigitalOut redled(LED1); //displays the metronome beat Ticker beat_rate; //define a Ticker, with name “beat_rate” void beat(void); -float period (0.5); //metronome period in seconds, inital value 0.5 -int rate (120); //metronome rate, initial value 120 +float period (1); //metronome period in seconds, inital value 0.5 +int rate (60); //metronome rate, initial value 120 int main() { pc.printf("\r\n");