Created
November 17, 2014 19:33
-
-
Save liorkesos/c2254b7c4a13763863f6 to your computer and use it in GitHub Desktop.
cylon analog read
This file contains hidden or 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
var Cylon = require('cylon'); | |
Cylon.robot({ | |
connection: { | |
name: 'voodoospark', | |
adaptor: 'voodoospark', | |
accessToken: '7934611bc6bf91b50c67a4477d2e90bad4b8f561', | |
deviceId: '53ff6e066667574847462567', | |
module: 'cylon-spark' | |
}, | |
/* | |
device: { | |
name: 'led', | |
driver: 'led', | |
pin: 'D7' | |
}, | |
*/ | |
device: { | |
name: 'sensor', | |
driver: 'analogSensor', | |
pin: 'A7' | |
}, | |
work: function(my) { | |
every((1).second(), function() { | |
analogValue = my.sensor.analogRead(); | |
console.log('Analog value => ', analogValue); | |
}); | |
} | |
}).start(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment