SlideShare a Scribd company logo
1 of 43
Download to read offline
RISE OF THE NODEBOTS
Presented by Joel Lord
Midwest JS
August 18th 2017
@joel__lord
#midwestjs
ABOOT ME, EH?
Javascript Junkie
Technology enthusiast
Tinkerer
8/18/17 2
@joel__lord
#midwestjs
AGENDA
Demo
Hardware
Software
Setting up the Arduino board
Setting up the project
Building a Hello World!
Building the Night light
8/18/17 3
@joel__lord
#midwestjs
I LIKE ROBOTS
8/18/17 4
@joel__lord
#midwestjs
I LIKE ROBOTS
8/18/17 5
Travel Tip !
@joel__lord
#midwestjs
I LIKE ROBOTS
8/18/17 6
@joel__lord
#midwestjs
OUR FINAL PRODUCT
8/18/17 7
@joel__lord
#midwestjs
YOUR KIT
1 Arduino board
1 USB Cable
1 Breadboard
4 Jumper Cables
2 Red LEDs
2 220 ohms Resistors
1 Photoresistor
1 1k ohms Resistor
8/18/17 8
@joel__lord
#midwestjs
HARDWARE - ARDUINO
Open Source hardware and software
Uses an ATMega programmable chip
Programmable in C
We can use the serial port to send
instructions using the Standard
Firmata
(https://github.com/firmata/arduino)
8/18/17 9
HARDWARE
8/18/17 10
@joel__lord
#midwestjs
HARDWARE - BREADBOARDS
8/18/17 11
@joel__lord
#midwestjs
HARDWARE - RESISTORS
8/18/17 12
𝑅 =
𝑉
𝐼
𝑅 =	
5𝑣
0.02𝐴
𝑅 = 250	
𝑣
𝐴
𝑅 = 250Ω
SOFTWARE
8/18/17 13
@joel__lord
#midwestjs
SOFTWARE - NODE
JavaScript runtime built on Chrome's
V8 JavaScript engine.
Open Source and available freely
Available at https://nodejs.org/
8/18/17 14
@joel__lord
#midwestjs
SOFTWARE - NPM
Node Package Manager
Comes out of the box with NodeJs
Available at https://www.npmjs.com/
8/18/17 15
@joel__lord
#midwestjs
SOFTWARE – JOHNNY FIVE
Available through npm
Documentation at http://johnny-
five.io/
8/18/17 16
PROJECT SETUP
8/18/17 17
@joel__lord
#midwestjs
SETTING UP THE ARDUINO
To enable communication with the serial port, you need the Standard Firmata
Plus installed
https://github.com/firmata/arduino
All the boards today come pre-configured
Still, here is how to install it
8/18/17 18
@joel__lord
#midwestjs
SETUP YOUR PROJECT
Create a new project using
­ npm init
Install Johnny-Five using
­ npm install --save johnny-five
8/18/17 19
@joel__lord
#midwestjs
SETUP YOUR PROJECT – NPM INIT
> npm init
name: (test)
version: (1.0.0)
description:
entry point: (index.js)
test command:
git repository:
keywords:
author:
license: (ISC)
About to write to /Users/jlord/Documents/Projects/test/package.json:
{
"name": "test",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo "Error: no test specified" && exit 1"
},
"author": "",
"license": "ISC"
}
Is this ok? (yes)
8/18/17 20
@joel__lord
#midwestjs
SETUP YOUR PROJECT – INSTALL JOHNNY-FIVE
8/18/17 21
> npm install --save johnny-five
npm WARN package.json test@1.0.0 No description
npm WARN package.json test@1.0.0 No repository field.
npm WARN package.json test@1.0.0 No README data

> serialport@4.0.7 install /Users/jlord/Documents/Projects/test/node_modules/johnny-five/node_modules/serialport
> node-pre-gyp install --fallback-to-build
[serialport] Success: "/Users/jlord/Documents/Projects/test/node_modules/johnny-
five/node_modules/serialport/build/Release/serialport.node" is installed via remote
johnny-five@0.10.6 node_modules/johnny-five
├── lodash.debounce@4.0.8
├── lodash.clonedeep@4.5.0
├── ease-component@1.0.0
├── color-convert@1.2.2
├── browser-serialport@2.1.0
├── temporal@0.5.0
├── nanotimer@0.3.10
├── firmata@0.15.0
├── chalk@1.1.3 (escape-string-regexp@1.0.5, ansi-styles@2.2.1, supports-color@2.0.0, has-ansi@2.0.0, strip-ansi@3.0.1)
├── es6-shim@0.35.2
└── serialport@4.0.7 (bindings@1.2.1, commander@2.9.0, lie@3.1.0, debug@2.6.0, nan@2.5.0, object.assign@4.0.4)
HELLO WORLD
8/18/17 22
@joel__lord
#midwestjs
WIRING UP A LED
8/18/17 23
@joel__lord
#midwestjs
CODING OUR LED
8/18/17 24
var j5 = require("johnny-five");
@joel__lord
#midwestjs
CODING OUR LED
8/18/17 25
var board = new j5.Board();
@joel__lord
#midwestjs
CODING OUR LED
8/18/17 26
board.on("ready", function() {
});
@joel__lord
#midwestjs
CODING OUR LED
8/18/17 27
var led = new j5.Led(13);
@joel__lord
#midwestjs
CODING OUR LED
8/18/17 28
led.blink(500);
@joel__lord
#midwestjs
CODING OUR LED
8/18/17 29
var j5 = require("johnny-five");
var board = new j5.Board();
board.on("ready", function() {
var led = new j5.Led(13);
led.blink(500);
});
Issues on your Mac ? http://www.wch.cn/download/CH341SER_MAC_ZIP.html
@joel__lord
#midwestjs
SHOW ME SOME BLINK
8/18/17 30
Ø node hello.js
1484955651472 Device(s) /dev/cu.usbmodem1421
1484955651484 Connected /dev/cu.usbmodem1421
1484955653114 Repl Initialized
>>
Ø
BUILD A NIGHT LIGHT
8/18/17 31
@joel__lord
#midwestjs
WIRING
8/18/17 32
@joel__lord
#midwestjs
CODING
8/18/17 33
var j5 = require("johnny-five");
@joel__lord
#midwestjs
CODING
8/18/17 34
var board = new j5.Board();
@joel__lord
#midwestjs
CODING
8/18/17 35
board.on("ready", function() {
});
@joel__lord
#midwestjs
CODING
8/18/17 36
var led = new j5.Led(13);
@joel__lord
#midwestjs
CODING
8/18/17 37
var sensor = new j5.Sensor("A0");
@joel__lord
#midwestjs
CODING
8/18/17 38
sensor.on("change", function() {
});
@joel__lord
#midwestjs
CODING
8/18/17 39
if (sensor.value > 750) {
led.on();
}
@joel__lord
#midwestjs
CODING
8/18/17 40
else {
led.off();
}
@joel__lord
#midwestjs
CODING
8/18/17 41
var j5 = require("johnny-five");
var board = new j5.Board();
board.on("ready", function() {
var led = new j5.Led(13);
var sensor = new j5.Sensor("A0");
sensor.on("change", function() {
if (sensor.value > 750) {
led.on();
} else {
led.off();
}
});
});
@joel__lord
#midwestjs
CODING
8/18/17 42
Ø node index.js
1484955651472 Device(s) /dev/cu.usbmodem1421
1484955651484 Connected /dev/cu.usbmodem1421
1484955653114 Repl Initialized
>>
Ø
@joel__lord
#midwestjs
THE END – THANK YOU !
8/18/17 43
Presented by
Joel Lord
August 18th 2017
Twitter: @joel__lord
Github: joellord

More Related Content

Similar to Rise of the Nodebots

Exploring Raspberry Pi
Exploring Raspberry PiExploring Raspberry Pi
Exploring Raspberry Pi
Lentin Joseph
 

Similar to Rise of the Nodebots (20)

Banana pi bpi-r1 user manual
Banana pi bpi-r1 user manualBanana pi bpi-r1 user manual
Banana pi bpi-r1 user manual
 
Exploring Raspberry Pi
Exploring Raspberry PiExploring Raspberry Pi
Exploring Raspberry Pi
 
JavaScript and Internet Controlled Electronics
JavaScript and Internet Controlled ElectronicsJavaScript and Internet Controlled Electronics
JavaScript and Internet Controlled Electronics
 
What & How to Customize Android?
What & How to Customize Android?What & How to Customize Android?
What & How to Customize Android?
 
Raspberry Pi 2 + Windows 10 IoT Core + Node.js
Raspberry Pi 2 + Windows 10 IoT Core + Node.jsRaspberry Pi 2 + Windows 10 IoT Core + Node.js
Raspberry Pi 2 + Windows 10 IoT Core + Node.js
 
Lecture02web 140phpapp01
Lecture02web 140phpapp01Lecture02web 140phpapp01
Lecture02web 140phpapp01
 
Meng
MengMeng
Meng
 
Meng
MengMeng
Meng
 
[HTML5DevConf SF] Hardware Hacking for Javascript Developers
[HTML5DevConf SF] Hardware Hacking for Javascript Developers[HTML5DevConf SF] Hardware Hacking for Javascript Developers
[HTML5DevConf SF] Hardware Hacking for Javascript Developers
 
Developing Android Platform Tools
Developing Android Platform ToolsDeveloping Android Platform Tools
Developing Android Platform Tools
 
Prometheus as exposition format for eBPF programs running on Kubernetes
Prometheus as exposition format for eBPF programs running on KubernetesPrometheus as exposition format for eBPF programs running on Kubernetes
Prometheus as exposition format for eBPF programs running on Kubernetes
 
Node.js meets jenkins
Node.js meets jenkinsNode.js meets jenkins
Node.js meets jenkins
 
Повний тестздець SPA + REST
Повний тестздець SPA + RESTПовний тестздець SPA + REST
Повний тестздець SPA + REST
 
Lab Handson: Power your Creations with Intel Edison!
Lab Handson: Power your Creations with Intel Edison!Lab Handson: Power your Creations with Intel Edison!
Lab Handson: Power your Creations with Intel Edison!
 
Raspberry Pi
Raspberry Pi Raspberry Pi
Raspberry Pi
 
Happy porting x86 application to android
Happy porting x86 application to androidHappy porting x86 application to android
Happy porting x86 application to android
 
Prepara tu entorno para Magento 2
Prepara tu entorno para Magento 2Prepara tu entorno para Magento 2
Prepara tu entorno para Magento 2
 
Abusing phones to make the internet of things - JSConf EU 2014
Abusing phones to make the internet of things - JSConf EU 2014Abusing phones to make the internet of things - JSConf EU 2014
Abusing phones to make the internet of things - JSConf EU 2014
 
An intro to the JAMStack and Eleventy
An intro to the JAMStack and EleventyAn intro to the JAMStack and Eleventy
An intro to the JAMStack and Eleventy
 
Raspberry pi-spectrum-analyzer-display-on-rgb-led-strip
Raspberry pi-spectrum-analyzer-display-on-rgb-led-stripRaspberry pi-spectrum-analyzer-display-on-rgb-led-strip
Raspberry pi-spectrum-analyzer-display-on-rgb-led-strip
 

More from Joel Lord

More from Joel Lord (20)

From Ceasar Cipher To Quantum Cryptography
From Ceasar Cipher To Quantum CryptographyFrom Ceasar Cipher To Quantum Cryptography
From Ceasar Cipher To Quantum Cryptography
 
I Don't Care About Security (And Neither Should You)
I Don't Care About Security (And Neither Should You)I Don't Care About Security (And Neither Should You)
I Don't Care About Security (And Neither Should You)
 
I Don't Care About Security (And Neither Should You)
I Don't Care About Security (And Neither Should You)I Don't Care About Security (And Neither Should You)
I Don't Care About Security (And Neither Should You)
 
I Don't Care About Security (And Neither Should You)
I Don't Care About Security (And Neither Should You)I Don't Care About Security (And Neither Should You)
I Don't Care About Security (And Neither Should You)
 
Forgot Password? Yes I Did!
Forgot Password? Yes I Did!Forgot Password? Yes I Did!
Forgot Password? Yes I Did!
 
I Don't Care About Security (And Neither Should You)
I Don't Care About Security (And Neither Should You)I Don't Care About Security (And Neither Should You)
I Don't Care About Security (And Neither Should You)
 
Mot de passe oublié? Absolument!
Mot de passe oublié? Absolument!Mot de passe oublié? Absolument!
Mot de passe oublié? Absolument!
 
Asynchronicity: concurrency. A tale of
Asynchronicity: concurrency. A tale ofAsynchronicity: concurrency. A tale of
Asynchronicity: concurrency. A tale of
 
Learning Machine Learning
Learning Machine LearningLearning Machine Learning
Learning Machine Learning
 
Forgot Password? Yes I Did!
Forgot Password? Yes I Did!Forgot Password? Yes I Did!
Forgot Password? Yes I Did!
 
WTH is a JWT
WTH is a JWTWTH is a JWT
WTH is a JWT
 
I Don't Care About Security (And Neither Should You)
I Don't Care About Security (And Neither Should You)I Don't Care About Security (And Neither Should You)
I Don't Care About Security (And Neither Should You)
 
Forgot Password? Yes I Did!
Forgot Password? Yes I Did!Forgot Password? Yes I Did!
Forgot Password? Yes I Did!
 
I Don't Care About Security (And Neither Should You)
I Don't Care About Security (And Neither Should You)I Don't Care About Security (And Neither Should You)
I Don't Care About Security (And Neither Should You)
 
WTH is a JWT
WTH is a JWTWTH is a JWT
WTH is a JWT
 
Asynchonicity: concurrency. A tale of
Asynchonicity: concurrency. A tale ofAsynchonicity: concurrency. A tale of
Asynchonicity: concurrency. A tale of
 
I Don't Care About Security
I Don't Care About Security I Don't Care About Security
I Don't Care About Security
 
I Don't Care About Security (And Neither Should You)
I Don't Care About Security (And Neither Should You)I Don't Care About Security (And Neither Should You)
I Don't Care About Security (And Neither Should You)
 
I Don't Care About Security (And Neither Should You)
I Don't Care About Security (And Neither Should You)I Don't Care About Security (And Neither Should You)
I Don't Care About Security (And Neither Should You)
 
Secure your SPA with Auth0
Secure your SPA with Auth0Secure your SPA with Auth0
Secure your SPA with Auth0
 

Recently uploaded

一比一原版(UWE毕业证书)西英格兰大学毕业证原件一模一样
一比一原版(UWE毕业证书)西英格兰大学毕业证原件一模一样一比一原版(UWE毕业证书)西英格兰大学毕业证原件一模一样
一比一原版(UWE毕业证书)西英格兰大学毕业证原件一模一样
Fi
 
一比一原版美国北卡罗莱纳大学毕业证如何办理
一比一原版美国北卡罗莱纳大学毕业证如何办理一比一原版美国北卡罗莱纳大学毕业证如何办理
一比一原版美国北卡罗莱纳大学毕业证如何办理
A
 
一比一原版布兰迪斯大学毕业证如何办理
一比一原版布兰迪斯大学毕业证如何办理一比一原版布兰迪斯大学毕业证如何办理
一比一原版布兰迪斯大学毕业证如何办理
A
 
一比一原版帝国理工学院毕业证如何办理
一比一原版帝国理工学院毕业证如何办理一比一原版帝国理工学院毕业证如何办理
一比一原版帝国理工学院毕业证如何办理
F
 
一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理
F
 
一比一定制波士顿学院毕业证学位证书
一比一定制波士顿学院毕业证学位证书一比一定制波士顿学院毕业证学位证书
一比一定制波士顿学院毕业证学位证书
A
 
一比一原版桑佛德大学毕业证成绩单申请学校Offer快速办理
一比一原版桑佛德大学毕业证成绩单申请学校Offer快速办理一比一原版桑佛德大学毕业证成绩单申请学校Offer快速办理
一比一原版桑佛德大学毕业证成绩单申请学校Offer快速办理
apekaom
 
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
ayvbos
 
一比一原版(NYU毕业证书)美国纽约大学毕业证学位证书
一比一原版(NYU毕业证书)美国纽约大学毕业证学位证书一比一原版(NYU毕业证书)美国纽约大学毕业证学位证书
一比一原版(NYU毕业证书)美国纽约大学毕业证学位证书
c6eb683559b3
 
一比一原版(USYD毕业证书)悉尼大学毕业证原件一模一样
一比一原版(USYD毕业证书)悉尼大学毕业证原件一模一样一比一原版(USYD毕业证书)悉尼大学毕业证原件一模一样
一比一原版(USYD毕业证书)悉尼大学毕业证原件一模一样
ayvbos
 
一比一原版(Polytechnic毕业证书)新加坡理工学院毕业证原件一模一样
一比一原版(Polytechnic毕业证书)新加坡理工学院毕业证原件一模一样一比一原版(Polytechnic毕业证书)新加坡理工学院毕业证原件一模一样
一比一原版(Polytechnic毕业证书)新加坡理工学院毕业证原件一模一样
AS
 
原版定制(LBS毕业证书)英国伦敦商学院毕业证原件一模一样
原版定制(LBS毕业证书)英国伦敦商学院毕业证原件一模一样原版定制(LBS毕业证书)英国伦敦商学院毕业证原件一模一样
原版定制(LBS毕业证书)英国伦敦商学院毕业证原件一模一样
AS
 

Recently uploaded (20)

一比一原版(UWE毕业证书)西英格兰大学毕业证原件一模一样
一比一原版(UWE毕业证书)西英格兰大学毕业证原件一模一样一比一原版(UWE毕业证书)西英格兰大学毕业证原件一模一样
一比一原版(UWE毕业证书)西英格兰大学毕业证原件一模一样
 
HUMANIZE YOUR BRAND - FREE E-WORKBOOK Download Now
HUMANIZE YOUR BRAND - FREE E-WORKBOOK Download NowHUMANIZE YOUR BRAND - FREE E-WORKBOOK Download Now
HUMANIZE YOUR BRAND - FREE E-WORKBOOK Download Now
 
一比一原版美国北卡罗莱纳大学毕业证如何办理
一比一原版美国北卡罗莱纳大学毕业证如何办理一比一原版美国北卡罗莱纳大学毕业证如何办理
一比一原版美国北卡罗莱纳大学毕业证如何办理
 
一比一原版布兰迪斯大学毕业证如何办理
一比一原版布兰迪斯大学毕业证如何办理一比一原版布兰迪斯大学毕业证如何办理
一比一原版布兰迪斯大学毕业证如何办理
 
Lowongan Kerja LC Yogyakarta Terbaru 085746015303
Lowongan Kerja LC Yogyakarta Terbaru 085746015303Lowongan Kerja LC Yogyakarta Terbaru 085746015303
Lowongan Kerja LC Yogyakarta Terbaru 085746015303
 
一比一原版帝国理工学院毕业证如何办理
一比一原版帝国理工学院毕业证如何办理一比一原版帝国理工学院毕业证如何办理
一比一原版帝国理工学院毕业证如何办理
 
Abortion Pills In Jeddah+966572737505 & Get cytotec Jeddah
Abortion Pills In Jeddah+966572737505 & Get cytotec JeddahAbortion Pills In Jeddah+966572737505 & Get cytotec Jeddah
Abortion Pills In Jeddah+966572737505 & Get cytotec Jeddah
 
一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理
 
一比一定制波士顿学院毕业证学位证书
一比一定制波士顿学院毕业证学位证书一比一定制波士顿学院毕业证学位证书
一比一定制波士顿学院毕业证学位证书
 
APNIC Policy Roundup presented by Sunny Chendi at TWNOG 5.0
APNIC Policy Roundup presented by Sunny Chendi at TWNOG 5.0APNIC Policy Roundup presented by Sunny Chendi at TWNOG 5.0
APNIC Policy Roundup presented by Sunny Chendi at TWNOG 5.0
 
Loker Pemandu Lagu LC Semarang 085746015303
Loker Pemandu Lagu LC Semarang 085746015303Loker Pemandu Lagu LC Semarang 085746015303
Loker Pemandu Lagu LC Semarang 085746015303
 
一比一原版桑佛德大学毕业证成绩单申请学校Offer快速办理
一比一原版桑佛德大学毕业证成绩单申请学校Offer快速办理一比一原版桑佛德大学毕业证成绩单申请学校Offer快速办理
一比一原版桑佛德大学毕业证成绩单申请学校Offer快速办理
 
Dan Quinn Commanders Feather Dad Hat Hoodie
Dan Quinn Commanders Feather Dad Hat HoodieDan Quinn Commanders Feather Dad Hat Hoodie
Dan Quinn Commanders Feather Dad Hat Hoodie
 
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
 
一比一原版(NYU毕业证书)美国纽约大学毕业证学位证书
一比一原版(NYU毕业证书)美国纽约大学毕业证学位证书一比一原版(NYU毕业证书)美国纽约大学毕业证学位证书
一比一原版(NYU毕业证书)美国纽约大学毕业证学位证书
 
一比一原版(USYD毕业证书)悉尼大学毕业证原件一模一样
一比一原版(USYD毕业证书)悉尼大学毕业证原件一模一样一比一原版(USYD毕业证书)悉尼大学毕业证原件一模一样
一比一原版(USYD毕业证书)悉尼大学毕业证原件一模一样
 
APNIC Updates presented by Paul Wilson at CaribNOG 27
APNIC Updates presented by Paul Wilson at  CaribNOG 27APNIC Updates presented by Paul Wilson at  CaribNOG 27
APNIC Updates presented by Paul Wilson at CaribNOG 27
 
一比一原版(Polytechnic毕业证书)新加坡理工学院毕业证原件一模一样
一比一原版(Polytechnic毕业证书)新加坡理工学院毕业证原件一模一样一比一原版(Polytechnic毕业证书)新加坡理工学院毕业证原件一模一样
一比一原版(Polytechnic毕业证书)新加坡理工学院毕业证原件一模一样
 
原版定制(LBS毕业证书)英国伦敦商学院毕业证原件一模一样
原版定制(LBS毕业证书)英国伦敦商学院毕业证原件一模一样原版定制(LBS毕业证书)英国伦敦商学院毕业证原件一模一样
原版定制(LBS毕业证书)英国伦敦商学院毕业证原件一模一样
 
Beyond Inbound: Unlocking the Secrets of API Egress Traffic Management
Beyond Inbound: Unlocking the Secrets of API Egress Traffic ManagementBeyond Inbound: Unlocking the Secrets of API Egress Traffic Management
Beyond Inbound: Unlocking the Secrets of API Egress Traffic Management
 

Rise of the Nodebots