change tone sounds by altering the waveforms
Dependencies: mbed
Fork of 5_songs by
Diff: main.cpp
- Revision:
- 1:8922cc02aec7
- Parent:
- 0:0fb17f0d39e7
- Child:
- 2:610196c7b41c
--- a/main.cpp Mon May 09 19:52:47 2016 +0000 +++ b/main.cpp Tue May 10 16:49:06 2016 +0000 @@ -1,5 +1,6 @@ #include "mbed.h" // this tells us to load mbed related functions -#include "tones.h" // list of all the tones and their frequencies +#include "tones.h" // list of all the tones and their frequencies +#include "rtos.h" // using the rtos for timing features. Just want to block the play_song function until it is time to play the next note. PwmOut buzzer(D3); // our buzzer is a PWM output (pulse-width modulation) @@ -17,11 +18,13 @@ } static void play_song(int notes_left, int* melody, int* duration) { + // YOUR CODE HERE + } // this code runs when the microcontroller starts up -void main() { +int main() { // declare a melody int melody[] = { NOTE_E4, NOTE_D4, NOTE_C4, NOTE_D4, NOTE_E4, NOTE_E4, NOTE_E4,