Skip to content

Commit

Permalink
buzzer
Browse files Browse the repository at this point in the history
  • Loading branch information
Rex St John committed Feb 5, 2015
1 parent 779b040 commit 31d1a15
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
21 changes: 21 additions & 0 deletions recipies/Cylon-JS Sensor Examples/buzzer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Make the buzzer go beep
// Warning - this is going to be really annoying.
var Cylon = require('cylon');

Cylon.robot({
connections: {
edison: { adaptor: 'intel-iot'}
},

devices: {
pin: { driver: 'direct-pin', pin: 4 }
},

work: function(my) {
var value = 0;
every((1).second(), function() {
my.pin.digitalWrite(value);
value = (value == 0) ? 1 : 0;
});
}
}).start();
2 changes: 1 addition & 1 deletion recipies/Cylon-JS Sensor Examples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "edison-cylon",
"description": "A simple Edison blink sketch.",
"version": "0.0.1",
"main": "sound.js",
"main": "buzzer.js",
"engines": {
"node": ">=0.10.0"
},
Expand Down

0 comments on commit 31d1a15

Please sign in to comment.