Book Image

Intel Galileo Blueprints

By : Marco Schwartz
Book Image

Intel Galileo Blueprints

By: Marco Schwartz

Overview of this book

Table of Contents (19 chapters)
Intel Galileo Blueprints
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Free Chapter
1
Setting Up the Galileo Board and the Development Environment
Index

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.

Note

Here is the link to Dweet.io:

http://dweet.io/

We will use the following code. Let's examine it first so that you can understand it easily:

  1. We create a new XDK project first.

  2. 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');
  3. 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 = new mraa.Aio(1);
    temp_sensor_pin.setBit...