Having worked for some time with Arduino boards, I always wondered if there was another to interact with them. Right now what I have been doing is set up Arduino Boards with led, DC motors and so on after that I uploaded a sketch to have it all worked. Although this is really interesting and asks for more, I found the action to be quite passive.
This is where PubNub comes into action. PubNub is a global Data Stream Network and realtime infrastructure-as-a-service company. One of the cool features this company is the Publish/Subscribe model.
PubNub utilizes a Publish/Subscribe model for realtime data streaming and device signaling which lets you establish and maintain persistent socket connections to any device. One can publish messages to any given channel, and subscribing clients receive only messages associated with that channel. The message payload can be any JSON data including numbers, strings, arrays, and objects.
So put simply, J5 gives you access to the different components while PubNub let's you communicate between the web page ( read: any sort of Web Application ) and the baord in itself. You want the led on, no problem. You want to start the DC Motor, turn the led on, stop the DC motor, sure that is all possible ( and a lot more ).
WHAT DO YOU NEED TO HAVE THIS WORKED.
-Node.js is required.
-PubNub: To build an application that leverages the PubNub Data Stream, you need to sign up for your account to obtain API keys.
-Johnny Five: Install Johnny-five using the npm package manager.
-ARDUINO IDE is required to upload the only sketch you will need. Johnny-Five communicates with Arduino using the Firmata protocol, so you need to install StandardFirmata.
One last note: This is not the only way one ca communicate with a board. There are many example out there but for now, I like to talk about things I know so I hope this would be useful for someone.
That is pretty much it. I will be publishing articles with examples so watch this blog closely.