Overview
This is my first project using JavaScript to make a built-in LED blink every half-second on my Arduino MEGA. I followed along Chapter 1 in Kassandra Perchs’ book titled, Learning JavaScript Robotics (linked under Resources). The goals of this chapter were to:
- Explore JavaScript Robotics, NodeBots, and Johnny-Five
- Set up a development environment
- Blink an onboard LED
Setting Up Development Environment
Step One: Installed Node.JS (linked under Downloads)
Step Two: Created a project folder named “my-robotics-project”
Step Three: Installed Johnny-Five
Step Four: Connected Arduino MEGA and installed Firmata on the Arduino
Making the LED Blink
Step One: Downloading Atom and making a new file
I looked into a few different IDEs that I could try for writing the program. Ultimately I settled on using Atom (linked under downloads) since it seemed to be an easy to use environment and it was also free.
Step Two: Writing the Johnny-Five Script (taken from Perch’s book)
Step Three: Running the script
Step Four: Success!
Vocabulary Learned*
node-serialport: an NPM module that allows Node.JS to communicate with devices over a serial connection
NodeBot: any piece of hardware controlled using JavaScript and/or Node.JS
Microcontroller: a small computer that contains a processor, memory, and input/output. Acts as the “brains” of the project. Programs communicate with or load onto a microcontroller. (i.e. Arduino board)
Johnny-Five: an opensource robotics library for Node.JS. It’s built on top of node-serialport and allows the user to write JavaScript applications that communicate with microcontrollers
Integrated Development Environment (IDE): Spftware that acts as a text editor, debugger, and compiler
*definitions are paraphrased from Learning JavaScript Robotics and are not my own
Resources:
For instructions: Learning JavaScript Robotics by Kassandra Perch
Downloads:
Node.JS: https://nodejs.org/en/
Arduino IDE: https://www.arduino.cc/en/Main/Software
Atom IDE: https://atom.io
Materials:
Arduino MEGA