2014-12-15 16:21:06 -05:00
|
|
|
/*
|
|
|
|
|
* Author: Zion Orent <zorent@ics.com>
|
|
|
|
|
* Copyright (c) 2014 Intel Corporation.
|
|
|
|
|
*
|
2019-07-30 19:41:32 -07:00
|
|
|
* This program and the accompanying materials are made available under the
|
|
|
|
|
* terms of the The MIT License which is available at
|
|
|
|
|
* https://opensource.org/licenses/MIT.
|
2014-12-15 16:21:06 -05:00
|
|
|
*
|
2019-07-30 19:41:32 -07:00
|
|
|
* SPDX-License-Identifier: MIT
|
2014-12-15 16:21:06 -05:00
|
|
|
*/
|
|
|
|
|
|
2016-09-13 16:09:09 -07:00
|
|
|
//Load Speaker module
|
|
|
|
|
var Speaker = require('jsupm_speaker');
|
|
|
|
|
// Instantiate a Speaker on digital pin D2
|
|
|
|
|
var mySpeaker = new Speaker.Speaker(2);
|
2014-12-15 16:21:06 -05:00
|
|
|
|
|
|
|
|
// Play all 7 of the lowest notes
|
|
|
|
|
mySpeaker.playAll();
|
|
|
|
|
|
|
|
|
|
// Play a medium C-sharp
|
|
|
|
|
mySpeaker.playSound('c', true, "med");
|
|
|
|
|
|
|
|
|
|
// Print message when exiting
|
|
|
|
|
process.on('SIGINT', function()
|
|
|
|
|
{
|
|
|
|
|
console.log("Exiting...");
|
|
|
|
|
process.exit(0);
|
|
|
|
|
});
|