Skip to content

Instantly share code, notes, and snippets.

@woakas
Last active March 4, 2016 16:20
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 woakas/647e443ca66ef1f32947 to your computer and use it in GitHub Desktop.
Save woakas/647e443ca66ef1f32947 to your computer and use it in GitHub Desktop.
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