Last active
August 23, 2018 18:23
-
-
Save HansF/4f88fbce1d8a696639675468ce286f44 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Fri3dBuzzer.h> | |
Fri3dBuzzer buzzer = Fri3dBuzzer(); | |
float notes[ 13 ] = { 659.25,587.33,369.99,415.3 ,554.37,493.88,293.66,329.63,493.88,440,277.18,329.63,440 }; | |
float lengths[ 13 ] = { 1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 2, 2, 6 }; | |
void setup() { | |
// for the setup part | |
buzzer.setVolume( 255 ); | |
for( int i = 0; i < 13; i++ ) { | |
buzzer.setFrequency( notes[i] ); | |
delay( 120 * lengths[i] ); | |
} | |
buzzer.setVolume(0); | |
// end setup part | |
} | |
void loop() { | |
// niks nodig | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment