Step 1 - Install Node.js
Installation Overview (Node.js)
Installing Node and NPM is pretty straightforward; using the installer package available from the Node.js® web site.
Installation Steps
- Download the Windows installer from the Nodes.js® web site.
- Run the installer (the .msi file you downloaded in the previous step).
- Follow the prompts in the installer ( Accept the license agreement, click the NEXT button a bunch of times, and accept the default installation settings).
Installation Overview (Jonny-Five)
- Open Command Prompt.
- Write the following command
npm install johnny-five
- Wait for the installation.
Now, copy the code and save it into a .js file.
- var five = require("johnny-five");
- var board = new five.Board();
-
-
- board.on("ready", function() {
- console.log("Ready!");
- var led = new five.Led(13);
- led.blink(500);
- });
Step 2 - Setup Hardware
Plug the Arduino and open the command prompt.
First, you need to specify the folder.
Done.
Now, you can blink your Arduino LED using Node.js.