SlideShare uma empresa Scribd logo
1 de 43
Baixar para ler 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

Mais conteúdo relacionado

Semelhante a Rise of the Nodebots

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

Semelhante a 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
 

Mais de Joel Lord

Mais de 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
 

Último

Call Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Thalassery Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call G...
Thalassery Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call G...Thalassery Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call G...
Thalassery Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call G...
Call Girls In Delhi Whatsup 9873940964 Enjoy Unlimited Pleasure
 
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRLLucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
imonikaupta
 
💚😋 Salem Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
💚😋 Salem Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋💚😋 Salem Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
💚😋 Salem Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
nirzagarg
 
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
@Chandigarh #call #Girls 9053900678 @Call #Girls in @Punjab 9053900678
 

Último (20)

Real Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtReal Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirt
 
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
 
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
 
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
 
Microsoft Azure Arc Customer Deck Microsoft
Microsoft Azure Arc Customer Deck MicrosoftMicrosoft Azure Arc Customer Deck Microsoft
Microsoft Azure Arc Customer Deck Microsoft
 
Wadgaon Sheri $ Call Girls Pune 10k @ I'm VIP Independent Escorts Girls 80057...
Wadgaon Sheri $ Call Girls Pune 10k @ I'm VIP Independent Escorts Girls 80057...Wadgaon Sheri $ Call Girls Pune 10k @ I'm VIP Independent Escorts Girls 80057...
Wadgaon Sheri $ Call Girls Pune 10k @ I'm VIP Independent Escorts Girls 80057...
 
Call Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
Busty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort Service
Busty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort ServiceBusty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort Service
Busty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort Service
 
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
 
Thalassery Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call G...
Thalassery Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call G...Thalassery Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call G...
Thalassery Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call G...
 
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
 
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
 
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
 
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRLLucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
 
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
 
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
 
💚😋 Salem Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
💚😋 Salem Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋💚😋 Salem Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
💚😋 Salem Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
 
Wagholi & High Class Call Girls Pune Neha 8005736733 | 100% Gennuine High Cla...
Wagholi & High Class Call Girls Pune Neha 8005736733 | 100% Gennuine High Cla...Wagholi & High Class Call Girls Pune Neha 8005736733 | 100% Gennuine High Cla...
Wagholi & High Class Call Girls Pune Neha 8005736733 | 100% Gennuine High Cla...
 
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency""Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
 
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
 

Rise of the Nodebots