Overview
Johhny-Five is a well-documented javascript library that leverages Arduino’s StandardFirmataPlus
to allow for direct control of an Arduino, Raspberry Pi or other microcontroller straight forward and accessible. In this tutorial will walk through how to use it to control a physical output via an Arduino Uno.
Materials
- Arduino Uno board
- Arduino IDE
- node.js
- Johnny-Five module (
npm install --save johnny-five
)
Setup
- Create and initialize a new directory for this node.js system
mkdir j5_test
cd j5_test
npm init
- Install and save the Johnny-Five package
npm install --save johnny-five
- Upload the
StandardFirmataPlus
firmware to your Arduino- Open Arduino application and plug in your Arduino
- Open File>Examples>Firmata>StandardFirmataPlus
- Upload to your Arduino and close the Arduino application
- Use a text editor to open a new file and call it j5_test.js
- Copy and paste this code: