Sofian Hadiwijaya

Programming is a creative activity.

Blinky LED Using Intel Galileo Board

| Comments

After the IoT Hackathon event held at Crazy Hackerz Makerspace (7-8 March 2015), Intel decided to lend us the Intel Galileo for us to experiment and play around with it. In genereal Intel Galileo is embedded board which is a combination of the Arduino Uno with an Intel X1000 SoC Quark. In short, Intel Galileo is a mini computer with the concept of DIY (Do it Yourself) which is similar to the Raspberry Pi.

Interestingly Intel Galileo is compatible with Arduino and Arduini, an electric kit or open source electronic circuit board which includes the main components of a chip microcontroller with the type of AVR. So through Intel Galileo we can control the Arduino directly from Linux.

I would like to take this opportunity to invite you to understand the theory of Internet Of Things (IOT) based on Intel’s simple Galileo (for you who want to study in more depth about the IOT, you can study for free in intel iot course.

Since I am a Web Developer, I like it when Intel discusses about Nodejs (section 7), especially on the way to control the input/output Arduino. The tools that we will be making this time is Blinky Led with the use of Nodejs program. But how do we do this? Come join me while I show you the process.

Hardware Required

First of all to start this project we will need:

  • Intel Galileo
  • LED
  • Laptop/Computer (OS: Linux/Mac)

Connecting the Hardware

Make sure the device is Intel Galileo and connected to a working laptop/computer and connected to a network. To know the IP address of the Intel Galileo, we can use the command

1
$ arp-a

Find the Intel Galileo IP address

Since I use a LAN, I am able to see the mac address attached to the LAN port on the Intel Galileo. After retrieving the IP of the Intel Galileo, we remote login into Intel Galileo with the command

1
$ ssh root@[ip_intel_galileo]

Create a Folder

Upon entry into the Intel Galileo Linux, we will create a folder for our project. For example the folder name is First IOT then we make the command

1
$ mkdir first-iot && cd first-iot

Install the package

Furthermore, we can use a package that has been provided for communicating with the Arduino contained in Intel Galileo. One package that is available is galileo-io we can install the package with the command

1
$ npm install galileo-io

Enter the code

We will create a hello world on the board, which is made of blinking LED, with the following code:

server.js
1
2
3
4
5
6
7
8
9
10
var Galileo = require("galileo-io");
var board = new Galileo();
board.on("ready", function() {
  var byte = 0;
  this.pinMode(13,this.MODES.OUTPUT)

  setInterval(function(){
      board.digitalWrite(13,(byte ^=1))
  }, 500);
});

Write down the code in the file server.js example, to execute the code we use node server.js on the terminal. If you do not have the nodejs on the operating system, you can see the tutorial on the following link

Wooollllaaaaa!!! LED on pin 13 Arduino blinking

Comments