INTRO TO JAVASCRIPT ROBOTICS Suz Hinton @noopkat
ABOUT ME  Technical Evangelist at Microsoft  Open source hardware author  Member of NodeJS Hardware Working Group
AGENDA  Microcontroller boards  Inputs and Outputs  NodeJS on-board  NodeJS off-board  NodeJS as an IoT service  Resources
Q: WHAT ARE MOST ROBOTS MADE OF? A: MICROCONTROLLERS A: INPUTS AND OUTPUTS
Q: WHAT ARE MOST ROBOTS MADE OF? A: MICROCONTROLLERS A: INPUTS AND OUTPUTS
Arduino Uno Processor - ATMega328P Speed: 8MHz Memory: 32Kb Language: C++ Price: $24.95 USD Good for: Offline, simple projects Gotchas: No built in internet, modules are available
Tessel 2 Processor - Mediatek MT7620n Speed: 580MHz Memory: 32Gb flash, 64Mb RAM Language: NodeJS, Rust Price: $44.95 USD Extras: built in Wi-Fi, runs Linux Good for: Online, processor intensive projects
ESP8266 Processor – 32bit Tensilica Xtensa LX106 Speed: 80MHz Memory: 1MB Flash Language: Lua, C++ Price: $5 USD Extras: built in Wi-Fi, TLS capable Good for: Online, portable, low power projects Gotchas: Hard to work with
Q: WHAT ARE MOST ROBOTS MADE OF? A: MICROCONTROLLERS A: INPUTS AND OUTPUTS
INPUTS ‘read only’  sensors  switches  data
INPUT EXAMPLES  light sensor  touch sensor  humidity sensor  api response
OUTPUTS ‘write only’  state  data  movement
OUTPUT EXAMPLES  LED (light)  speaker  motor  data stream
YOU COULD MAKE… { precipitation: 6, probability: 100 }
TECHNIQUES
#1 : NODEJS ON BOARD with the Tessel2
$ npm install –g t2-cli $ npm install ambient-attx4 var tessel = require('tessel'); var ambientlib = require('ambient-attx4'); var ambient = ambientlib.use(tessel.port['A']); ambient.getLightLevel(); ambient.getSoundLevel();
#2 : NODEJS OFF BOARD with the Arduino Uno
$ npm install –g firmata-party $ firmata-party uno $ npm install johnny-five var five = require(‘johnny-five’); var board = new five.Board(); board.on(‘ready’, function() { var led = new five.Led(13); led.blink(500); });
#3 : NODEJS AS AN IOT SERVICE with the ESP8266
IOT TIARA
IoT Tiara ESP8266‘brain’ 3D printed band + crystals RGB LEDs for lighting Controlled by chat box on twitch.tv Connects to MQTT broker (Azure IoT Hub) NodeJS server sends commands via broker youtu.be/mxmfkz-kXX0
Azure IoT Hub tiara Azure Web App Twitch chat IRC channel
Azure IoT Hub tiara Azure Web App color picke r.html
#1 : NODEJS ON BOARD #2 : NODEJS OFF BOARD #3 : NODEJS AS AN IOT SERVICE
RESOURCES  tessel.io  arduino.cc  adafruit.com  nodebots.io  johnny-five.io microsoft.com/en-us/internet-of-things  github.com/noopkat/iot-tiara

JavaScript Robotics #NodeWeek