Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed mbed-rtos SDFileSystem11
Diff: main.cpp
- Revision:
- 5:bc7213111da0
- Parent:
- 4:f14ca9203f62
- Child:
- 6:2450dc369670
--- a/main.cpp Mon Apr 26 21:29:08 2021 +0000 +++ b/main.cpp Mon Apr 26 21:31:02 2021 +0000 @@ -24,11 +24,39 @@ +DigitalOut led1(LED2); +DigitalOut f1(p21); +DigitalOut f2(p22); +DigitalOut f3(p23); +DigitalOut m1e(p5); +DigitalOut m2e(p6); +DigitalOut m3e(p7); +Ticker t1; +Ticker t2; +Ticker t3; +float motor1stop; +float motor2stop; +float motor3stop; -DigitalOut led1(LED1); -Ticker t; -Ticker t1; - +Timer motor1timer; + void flip1() +{ + f1 = !f1; +} +void flip2() +{ + f2 = !f2; +} +void flip3(){ + f3 = !f3; +} +/* +Takes the midi number in from the array and then converts it to a frequency in hz; +*/ +float midi2freq(float midi){ + return 440.0*powf(2.0, (midi-69)/12); +} + int main() { bool holdNotes = 0; //Stop reading notes file bool holdStart = 0; //Stop reading start times