Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Where does the javascript run, anyway?
Search
C J Silverio
November 15, 2013
Programming
420
4
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Where does the javascript run, anyway?
A beginner's guide to hardware with Javascript.
C J Silverio
November 15, 2013
More Decks by C J Silverio
See All by C J Silverio
The economics of package management
ceejbot
4
1.6k
The future of (javascript) modules (in node)
ceejbot
1
350
Keeping JavaScript safe
ceejbot
3
500
ceej's how to solve it
ceejbot
6
790
work-life balance at npm
ceejbot
5
820
hash functions and you!
ceejbot
2
390
The accidental noder
ceejbot
2
190
Design Patterns & Modularity in the npm Registry
ceejbot
3
220
Monitoring on a budget
ceejbot
2
310
Other Decks in Programming
See All in Programming
月間100万人のサービス刷新で、 技術選定をHonoに振り切った話
yutobara
8
7.1k
社内AIエージェント「Askワンバン」における コストチューニングの取り組み
t0yohei
0
120
Compiling a real-world CLI tool to native with Static Hermes
tmikov2023
0
140
contenteditable と日本語入力に向き合う
colorful12
0
230
JIS keyboard support in Omarchy
lef237
0
170
Web Framework Benchmark Battle 2026, Any%
a_matsuda
3
3.1k
Modernizing iOS Apps
seyfoyun
0
140
あなたの await、OS まで届いてる? strace で覗く JavaScript の非同期
hasutosasaki
1
1.7k
AI-Powered Domain-Driven Design
ziobrando
0
360
Web3Dライブラリを作ってVue Custom Rendererの仕組みを理解しよう / lets learn vue custom renderer by making 3d library
drumath2237
1
110
AI主導のプログラミング学習アプリを作ってみた
econanringo
0
200
最近”作らせてる” ローカルAIアプリの話
akit37
0
520
Featured
See All Featured
Why Our Code Smells
bkeepers
PRO
340
58k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
First, design no harm
axbom
PRO
2
1.4k
GitHub's CSS Performance
jonrohan
1033
470k
Being A Developer After 40
akosma
PRO
92
590k
Testing 201, or: Great Expectations
jmmastey
46
8.4k
Product Roadmaps are Hard
iamctodd
55
13k
How to Think Like a Performance Engineer
csswizardry
28
2.9k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
370
How STYLIGHT went responsive
nonsquared
100
6.3k
Scaling GitHub
holman
464
140k
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2.2k
Transcript
Where does the javascript run, anyway? A beginner’s guide to
js + hardware C J Silverio @ceejbot
Tab Hunter easily located?
I never tracked the cat.
Then I went to a hack day.
None
That’s a cat about to be tracked.
Text Let’s talk microcontrollers. Arduino, Raspberry Pi, Beaglebone, and beyond.
Hardware input & output What the Arduino & the Pi
have in common: inputs and outputs.
Connect to the physical world. Turn lights on & off.
Run motors. Fire missiles at nodecopters. !
General-purpose I/O aka the GPIO or the “pin”
The super power of a microcontroller is the GPIO. The
GPIO connects variables in software to physical objects: the power level on a wire is information.
Breadboard 101 The + and – columns are connected. The
rows are connected. Board +/5V ➜ + Board ground ➜ –
Lighting an LED is simple. Power to breadboard resistor from
+ to long wire on the LED LED short wire to breadboard – – to board GND
Software! Decision-making! Now we make the microcontroller do some work.
Text Arduino Easy to start with! Lots of GPIO pins.
Text Button: a typical circuit power, ground, control signal software
on the Arduino to read its state
We’re about to get the javascript into it.
Johnny-Five to the rescue StandardFirmata sketch ➜ Arduino npm install
johnny- five write javascript
Async Goodness with Buttons ! var five = require('johnny-five'); var
board = new five.Board(); ! board.on('ready', function() { // signal goes into arduino pin 8 var button = new five.Button(8); ! button.on('down', function() { console.log('down'); }); button.on('up', function() { console.log('up'); }); button.on('hold', function() { console.log('holding'); }); });
Tethered. :( You need to stay connected to a host
capable of running Node.js, which the Arduino is not.
Upgrade the microcontroller! Let’s move from the early 80s to
the late 90s.
None
You run Linux on these. OMG.
Decisions, decisions. Arduino tiny Arduinos Raspberry Pi Beagle cheap cheaper
CPU! more CPU! 14 pins size varies 8 pins 65 pins lots of modules features vary great video more memory C++ js tethered C++ any language any language prototyping mobile projects general use, audio-vis CPU-intensive lots of connections
Text Cat Tracker uses 2 boards Teensy on the cat,
Beaglebone at the cat door
Next gen Tessel Espruino Javascript as first-class language
Next steps! Go to a hack day! http://nodebots.io Run a
hack day!
http://node-ardx.org The Arduino experimenter’s guide for Javascript
Practical Electronics for Inventors Paul Scherz & Simon Monk
Play! Putter around. Buy two of everything because you will
melt things sometimes. It’ll be okay.
Learn strange new things. USB? Bluetooth? Serial? Radios? Reverse-engineer something!
Go forth & build!