Project tutorial

Arduino Blink With Node.js © GPL3+

Johnny-Five is the JavaScript Robotics & IoT Platform; in here I'll show you how to blink an LED using Node.js with Johnny-Five.

  • 3,451 views
  • 4 comments
  • 23 respects

Components and supplies

Apps and online services

About this project

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

  • 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 in CMD.
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.

node blink.js //your file name  

Type this and hit Enter. Done. Now you can see the blink of your Arduino LED using Node.js.

Schematics

Arduino + LED
Image002 2rn29therp

Code

blinkJavaScript
    var five = require("johnny-five");  
    var board = new five.Board();     //adding johnny-five
    board.on("ready", function() {   
        console.log("Ready!");       //print Ready if it's ok
        var led = new five.Led(13);  //Arduino Pin-13
        led.blink(500);             //delay  
    });  

Comments

Similar projects you might like

Retro Nokia Snake Game with Arduino

Project tutorial by circuito.io team

  • 2,895 views
  • 2 comments
  • 23 respects

Arduino Memory Game

Project showcase by MakerRobotics

  • 614 views
  • 0 comments
  • 15 respects

Arduino - Web-Based MP3 Player

Project tutorial by khanhhs

  • 2,088 views
  • 0 comments
  • 13 respects

Play Music With Your Remote

Project tutorial by Simone Adobs

  • 518 views
  • 8 comments
  • 3 respects

Arduino Dynamic Web Control

Project tutorial by phpoc_man

  • 15,133 views
  • 13 comments
  • 60 respects

Wizard's Walking Staff

Project tutorial by Lucas Ainsworth

  • 2,793 views
  • 4 comments
  • 29 respects
Add projectSign up / Login