Embedded Linux
  • Cover
  • Summary
  • About This Training
    • Objectives
    • Skills
    • Prerequisites
    • Requirements
  • Once Upon A Time ...
  • Embedded Linux
  • Build Systems
    • Yocto Board Support Package
      • Yocto
      • Compilation
        • Make
        • Bitbake
        • Script
      • Building Blocks
      • SDK
      • Extra Packages
      • Kernel
        • Patch
        • Building
        • Headers
      • Modules
        • Cross Compilation
        • Native
      • Filesystem
      • Flashing
    • Distributions
      • CentOS
      • Google Brillo
      • Jubilinux
      • Kali
      • Ostro
      • Ubilinux
      • Debian
  • Boot Loaders
    • U-Boot
  • Initialization
    • Upgrade
    • Boot Up
    • Dual Boot
    • Root Directory
    • Display Message
    • Modules
    • Filesystem
    • Memory
    • Backup
    • Recovery
    • Reboot
    • Processes
  • User Space
    • Virtual Network Computing
    • Text Editors
    • Services
    • Logs
    • Package Management Systems
      • Open Package Management
      • Python Package Index
      • Nicely Package Make
      • Advanced Packaging Tool
      • Manual
      • Conda
    • Libraries
      • Mraa
      • Upm
      • OpenCv
      • Temboo
      • Libiio
    • Frameworks
      • Cylon JS
      • Johnny Five
      • ROS
      • Gobot
      • Pixhawk
      • Artoo
      • Bower
      • Zetta
      • Miscellaneous
  • Subsystems
    • X File Systems
    • Pin Muxing
    • Virtual File System
    • Memory
    • Input
    • General Purpose Input Output
    • Serial
    • Bluetooth
      • Advanced Audio Distribution Profile
        • Bluez
        • Gstreamer
        • Alsa
      • Human Interface Device Game Controller
      • Serial Port Protocol
      • Arduino
    • WiFi
    • Audio
    • Camera
    • Block
    • Universal Serial Bus
      • Human Interface Device Mini Keyboard
      • Python USB
    • Inter Integrated Circuit
    • Inter Process Communication
    • Peripheral Component Interconnect
    • Clock
    • Modems
    • Networking
    • Power
    • Thermal
    • Graphics
    • LED
    • LIDAR
    • Printer
    • Serial Peripheral Interface
  • Application Development
    • C
    • C++
    • Cross Compile
    • Containers
    • Python
    • NodeJS
    • Cloud9
    • Data
    • Drone Code
    • Speech
      • Python
    • Radio Frequency
    • Bots
    • Artificial Intelligence
      • WitAi
      • MycroftAi
    • Games
    • Vision
      • Bar Codes
      • Google Cloud Vision API
    • Messaging
    • Entertainment
    • Home Assistants
    • Dashboards
    • IRC
    • Location
    • Facial Recognition
    • Software Defined Radio
    • REST
    • Notes
    • Security
    • HAM Radio
    • Automotive
    • Digital Signage
    • Photography
  • Debug
  • Wrap-Up
    • Online Training
    • Challenge
    • Tbd
  • SandBox
Powered by GitBook
On this page
  • galileo-io
  • edison-io
  • LCD I2C
  • Buzzer
  1. User Space
  2. Frameworks

Johnny Five

PreviousCylon JSNextROS

Last updated 7 years ago

The JavaScript "Tessel 2" Programming Framework

Johnny-Five is the original JavaScript Robotics programming framework. Released by Bocoup in 2012, Johnny-Five is maintained by a community of passionate software developers and hardware engineers. Over 75 developers have made contributions towards building a robust, extensible and composable ecosystem.

galileo-io

Intel Galileo IO Plugin for Johnny-Five JavaScript Robotics

    root@edison:~# npm install galileo-io johnny-five
    -\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\-\|/-\|/--\|/-\|
    > galileo-io@0.9.4 postinstall /home/root/node_modules/galileo-io
    > node scripts/postinstall
    ...
    ��├��─��─ es6-shim@0.35.0
    ��└��─��─ serialport@2.0.6 (bindings@1.2.1, sf@0.1.7, async@0.9.0, debug@2.2.0, optimist@0.6.1, nan@2.0.9)
    root@edison:~# vi jf.js
var five = require("johnny-five");
var Edison = require("galileo-io");
var board = new five.Board({
  io: new Edison()
});

board.on("ready", function() {
  var led = new five.Led(13);
  led.blink(500);
});
    root@edison:~# node jf.js
    1459102398059 Device(s) Intel Edison  
    1459102398074 Connected Intel Edison  
    1459102398097 Repl Initialized  
    >> 
    ^C
    >> 1459102426530 Board Closing. 
    root@edison:~#

edison-io

Intel Edison IO Plugin for Johnny-Five JavaScript Robotics

Requirements:

  • Grove Button @ D4

    root@edison:~/trash# npm install johnny-five edison-io
    -\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-
    ...
    npm WARN engine edison-io@0.9.4: wanted: {"node":"latest"} (current: {"node":"0.10.38",")
    edison-io@0.9.4 ../node_modules/edison-io
    root@edison:~/trash# vi edi.js
var five = require("johnny-five");
var Edison = require("edison-io");
var board = new five.Board({
  io: new Edison()
});

board.on("ready", function() {

  var button = new five.Button(8);
  var led = new five.Led(13);

  button.on("press", function() {
    led.on();
  });

  button.on("release", function() {
    led.off();
  });
});
    root@edison:~/trash# node edi.js
    1459107445851 Device(s) Intel Edison  
    1459107445867 Connected Intel Edison  
    1459107445892 Repl Initialized  
    >>

Push Grove Button and see Board Led

    ^C
    (^C again to quit)
    >> 
    1459107452651 Board Closing.

LCD I2C

Requirements:

  • Grove LCD RGB Backlight @ I2C

var five = require("johnny-five");
var Edison = require("edison-io");
var board = new five.Board({
  io: new Edison()
});

board.on("ready", function() {

  var lcd = new five.LCD({
    controller: "JHD1313M1"
  });

  lcd.useChar("heart");
  lcd.cursor(0, 0).print("hello :heart:");
  lcd.blink();
  lcd.cursor(1, 0).print("Blinking? ");
});

Buzzer

Requirements:

var songs = require("j5-songs");
var five = require("johnny-five");
var Edison = require("edison-io");
var board = new five.Board({
  io: new Edison()
});

board.on("ready", function() {
  var buzzer = new five.Piezo(4);
  var tetris = songs.load("tetris-theme");
  buzzer.play(tetris);
});

Johnny Five Homepage
Johnny Five Github
Johnny Five IO Plugins
Intel Galileo & Intel Edison IO Plugin for Johnny-Five
Intel Edison + Grove IoT Kit Examples
NPM JS Galileo-Io
Grove - Buzzer