# Johnny Five

> 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.

* [Johnny Five Homepage](http://johnny-five.io/)
* [Johnny Five Github](https://github.com/rwaldron/johnny-five)
* [Johnny Five IO Plugins](https://github.com/rwaldron/johnny-five#io-plugins)
* [Intel Galileo & Intel Edison IO Plugin for Johnny-Five](https://github.com/rwaldron/galileo-io/)
* [Intel Edison + Grove IoT Kit Examples](http://johnny-five.io/news/intel-edison-+-grove-iot-kit-examples/)

## galileo-io

> Intel Galileo IO Plugin for Johnny-Five JavaScript Robotics

* [NPM JS Galileo-Io](https://www.npmjs.com/package/galileo-io)

```bash
    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
```

```javascript
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);
});
```

```bash
    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

```bash
    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
```

```javascript
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();
  });
});
```

```bash
    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

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

## LCD I2C

Requirements:

* Grove LCD RGB Backlight @ I2C

```javascript
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:

* [Grove - Buzzer](https://www.seeedstudio.com/Grove-Buzzer-p-768.html)

```javascript
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);
});
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://theiotlearninginitiative.gitbook.io/embedded-linux/user-space/frameworks/johnny-five.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
