Interested in the world of hardware hacking, but feeling left out because you just don’t have the time to learn another language? Or maybe you aren’t comfortable using Sketch to program? Have no fear, you can easily use JavaScript to program boards like Arduino and Genuino. Yes, just JavaScript!
In this series of video tutorials, Tomomi Imura from PubNub shows you how to start hacking an Arduino board with Node.js using Johnny-Five, a JavaScript Robotics Framework.
Part One covers:
- Setting up a board.
- Building the Hello World of hardware, a LED blink.
- Writing your Johnny-Five code to make it blink according to the program.
Enjoy the tutorial!
EXPANDED TECHNICAL DETAILS
JavaScript Hardware Control
Johnny-Five is one of the most popular JavaScript Robotics & IoT frameworks. It allows developers to control Arduinos using Node.js instead of C++.
- Firmata Protocol: The Arduino runs a standard piece of firmware called
StandardFirmata. This turns the Arduino into an I/O expander for the host PC or Raspberry Pi. - Serial over USB: Node.js communicates with the board via the Serial port, sending high-level commands like
led.blink()orservo.to(90).
IoT Integration
- PubNub Connectivity: This project demonstrates "Part 1" by connecting the hardware to the PubNub API. This allows for real-time data streaming and remote control of the Arduino from any web browser in the world via a secure publish/subscribe messaging layer.