Logging your data in the cloud
As discussed, we will first log the data in the cloud. Here, we will use the same hardware and software configurations that we used in the previous chapter.
To log data in the cloud, we will use a service called Dweet.io. Dweet.io is a simple publishing and subscribing platform created for machines, gadgets, and any form of computer. There's no sign up or set up required so you can use it instantly.
We will use the following code. Let's examine it first so that you can understand it easily:
- We create a new XDK project first.
- Then, we include the following libraries, which are used to communicate with the pins of the Galileo board:
var mraa = require("mraa"); var util = require('util'); var request = require('request');
- We need to set the analog pins and set their resolution to 12 bits:
var light_sensor_pin = new mraa.Aio(0); light_sensor_pin.setBit(12); var temp_sensor_pin...