We have been talking about home automation controlling electrical loads, but everything has a starting point. The most basic kick-starter is controlling Edison over the Internet—that's what it's all about.
When you have a device that is controllable over the Internet, we recommend controlling the electrical loads. In this other mini-project, we are going to control a simple LED that is already attached to pin 13 of Intel Edison. There is no need for any external hardware for this, as we are using an in-built functionality. Now, open your editor and type in the following code:
var mraa = require('mraa'); var mqtt = require('mqtt');
varledPin=new mraa.Gpio(13); ledPin.dir(mraa.DIR_OUT);
var client = mqtt.connect('mqtt://iot.eclipse.org'); client.subscribe('avirup/control/#') client.handleMessage=function(packet,callback)
{
...