Skip to content

Instantly share code, notes, and snippets.

@Resseguie
Created July 21, 2014 03:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Resseguie/b2ca06cc68e88d245bd7 to your computer and use it in GitHub Desktop.
Save Resseguie/b2ca06cc68e88d245bd7 to your computer and use it in GitHub Desktop.
Joy to the World using J5 piezo. Crashes at "come" ( ["C4", 1] ) because it's missing a comma
var five = require('johnny-five');
five.Board().on('ready', function () {
var piezo = new five.Piezo();
var joyToWorld = {
song: [
["C5", 1],
["B4", 3/4],
["A4", 1/4],
["G4", 3/2],
["F4", 1/2],
["E4", 1],
["D4", 1],
["C4", 1]
[null, 1/2],
["G4", 1/2],
["A4", 3/2],
["A4", 1/2],
["B4", 3/2],
["B4", 1/2],
["C5", 1]
],
tempo: 80
};
// Play it !
piezo.play(joyToWorld, function() {
process.exit(1);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment