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.

  • 4,411 views
  • 4 comments
  • 25 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

Control LED Using Your Voice Command

by IoTBoys

  • 172 views
  • 0 comments
  • 7 respects

Version 2.0 Advanced Attendance System (Without Ethernet)

Project tutorial by GadgetProgrammers

  • 2,209 views
  • 5 comments
  • 41 respects

Get The Arduino Dice

by Ingo Lohs

  • 168 views
  • 0 comments
  • 4 respects

Musical Fairy Lights

Project tutorial by Ian Cumming

  • 278 views
  • 0 comments
  • 4 respects

Fluid Level Indicator and Controller

Project tutorial by Rushabh Jain

  • 553 views
  • 2 comments
  • 7 respects

Critter: Crawling Arduino Robot

Project showcase by Slant Concepts

  • 4,381 views
  • 7 comments
  • 28 respects
Add projectSign up / Login