Skip to content

Instantly share code, notes, and snippets.

@HansF
Last active August 23, 2018 18:23
Show Gist options
  • Save HansF/4f88fbce1d8a696639675468ce286f44 to your computer and use it in GitHub Desktop.
Save HansF/4f88fbce1d8a696639675468ce286f44 to your computer and use it in GitHub Desktop.
#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