Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Where does the javascript run, anyway?
Search
C J Silverio
November 15, 2013
Programming
4
380
Where does the javascript run, anyway?
A beginner's guide to hardware with Javascript.
C J Silverio
November 15, 2013
Tweet
Share
More Decks by C J Silverio
See All by C J Silverio
The economics of package management
ceejbot
4
1.5k
The future of (javascript) modules (in node)
ceejbot
1
280
Keeping JavaScript safe
ceejbot
3
440
ceej's how to solve it
ceejbot
6
760
work-life balance at npm
ceejbot
5
780
hash functions and you!
ceejbot
2
350
The accidental noder
ceejbot
2
140
Design Patterns & Modularity in the npm Registry
ceejbot
3
180
Monitoring on a budget
ceejbot
2
290
Other Decks in Programming
See All in Programming
データと事例で振り返るDevin導入の"リアル" / The Realities of Devin Reflected in Data and Case Studies
rkaga
3
2.9k
AI Coding Agents Enablement in TypeScript
yukukotani
8
1.6k
抽象データ型について学んだ
ryounasso
0
100
ソフトウェア保守性向上のためのユニットテストカバレッジの有効性評価
todooou183
2
170
SwiftDataのカスタムデータストアを試してみた
1mash0
0
150
DevDay2025-OracleDatabase-kernel-addressing-history
oracle4engineer
PRO
1
120
インプロセスQAにおいて大事にしていること / In-process QA Meetup
medley
0
190
rbs-traceを使ってWEARで型生成を試してみた After RubyKaigi 2025〜ZOZO、ファインディ、ピクシブ〜 / tried rbs-trace on WEAR
oyamakei
0
200
TSConfigからTypeScriptの世界を覗く
planck16
1
160
Cloudflare Workersで進めるリモートMCP活用
syumai
12
1.7k
GitHub Copilot for Azureを使い倒したい
ymd65536
1
350
SpringBootにおけるオブザーバビリティのなにか
irof
0
240
Featured
See All Featured
The Pragmatic Product Professional
lauravandoore
33
6.6k
Building a Modern Day E-commerce SEO Strategy
aleyda
40
7.3k
Building Adaptive Systems
keathley
41
2.5k
Build your cross-platform service in a week with App Engine
jlugia
231
18k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
667
120k
Stop Working from a Prison Cell
hatefulcrawdad
268
20k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
122
52k
GitHub's CSS Performance
jonrohan
1031
460k
Reflections from 52 weeks, 52 projects
jeffersonlam
349
20k
A Tale of Four Properties
chriscoyier
159
23k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
5
620
Large-scale JavaScript Application Architecture
addyosmani
512
110k
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!