forked from bocajs/NodeBotDays
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjohnnyFiveSample.js
More file actions
28 lines (23 loc) · 1008 Bytes
/
johnnyFiveSample.js
File metadata and controls
28 lines (23 loc) · 1008 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/*
BocaJS's Sample for the ESP8266 D1 Mini included in our Internation NodeBotDays Event
*/
var five = require("johnny-five"); // Magic
var EtherPortClient = require("etherport-client").EtherPortClient; // Connect through WIFI to your compatible StandardFirmataWiFi Device like our ESP8266 D1 Mini
// for YOUR regular arduino (non wifi) uncomment the next line and comment the section below
// var board = new five.Board({ port: "/dev/cu-usbserial" }); // make sure you find out which is your actual port. but only if it doesn't find it automatically.
// For the ESP8266 - D1 Mini from the event
var board = new five.Board({
port: new EtherPortClient({
host: "192.168.29.50", // Update this IP address to the IP address of YOUR device
port: 3030
}),
timeout: 1e5,
repl: false
});
// Starndard Johnny-Five Blink Example
board.on("ready", function() {
console.log("READY!");
var led = new five.Led(2);
led.blink(500);
console.log("IT'S BLINKING!!!");
});