Last active
March 4, 2016 16:20
-
-
Save woakas/647e443ca66ef1f32947 to your computer and use it in GitHub Desktop.
This file contains 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 mraa = require('mraa'); | |
var ubidots = require('ubidots'); | |
var analogPin0 = new mraa.Aio(0); //setup access analog input Analog pin #0 (A0) | |
var client = ubidots.createClient('APIKEY'); | |
client.auth(function() { | |
var v = this.getVariable('VARIABLE_ID'); | |
setInterval(function() { | |
var analogValue = analogPin0.read(); | |
console.log(analogValue); | |
v.saveValue(analogValue); | |
}, 1000); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment