Arduino Project Hub
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.

  • 2,678 views
  • 4 comments
  • 19 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

Arduino 101 - Intel Curie Pattern Matching Dress

Project tutorial by Team artbyphysicistkittyyeung

  • 87 views
  • 2 comments
  • 2 respects

Fun Cases for Electronic Components

Project in progress by circuito.io team

  • 1,529 views
  • 4 comments
  • 21 respects

Magnetic Stirrer

Project showcase by jdale18

  • 335 views
  • 6 comments
  • 3 respects

Simple Ultrasonic distance measurer with LCD display

Project tutorial by onatto22

  • 355 views
  • 0 comments
  • 5 respects

LOFI Blocks

by LOFI Robot

  • 35 views
  • 0 comments
  • 1 respect

Useless box

Project showcase by Igor Putnik and brzi

  • 980 views
  • 0 comments
  • 9 respects
Add projectSign up / Login