We are now going to learn how to take measurements from the temperature sensor and the photocell, and send them to the cloud to be logged. They will then be accessible from anywhere, and you will also be able to use them in other applications.
In the project in this recipe, we will take measurements from the sensors, connect to dweet.io, and then send the data to the dweet.io server.
This is the complete code for this recipe:
// Includes var mraa = require("mraa"); var util = require('util'); var request = require('request'); // Sensor pins var temp_sensor_pin = new mraa.Aio(0); temp_sensor_pin.setBit(12); var light_sensor_pin...