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
390
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.6k
The future of (javascript) modules (in node)
ceejbot
1
290
Keeping JavaScript safe
ceejbot
3
460
ceej's how to solve it
ceejbot
6
760
work-life balance at npm
ceejbot
5
790
hash functions and you!
ceejbot
2
350
The accidental noder
ceejbot
2
160
Design Patterns & Modularity in the npm Registry
ceejbot
3
190
Monitoring on a budget
ceejbot
2
290
Other Decks in Programming
See All in Programming
Promise.tryで実現する新しいエラーハンドリング New error handling with Promise try
bicstone
3
460
しっかり学ぶ java.lang.*
nagise
1
380
Agentに至る道 〜なぜLLMは自動でコードを書けるようになったのか〜
mackee
5
1.6k
レイトレZ世代に捧ぐ、今からレイトレを始めるための小径
ichi_raven
0
350
GraalVM Native Image トラブルシューティング機能の最新状況(2025年版)
ntt_dsol_java
0
140
TVerのWeb内製化 - 開発スピードと品質を両立させるまでの道のり
techtver
PRO
3
1.1k
組織もソフトウェアも難しく考えない、もっとシンプルな考え方で設計する #phpconfuk
o0h
PRO
10
4.4k
flutter_kaigi_2025.pdf
kyoheig3
1
330
競馬で学ぶ機械学習の基本と実践 / Machine Learning with Horse Racing
shoheimitani
13
12k
Rails Girls Sapporo 2ndの裏側―準備の日々から見えた、私が得たもの / SAPPORO ENGINEER BASE #11
lemonade_37
2
160
What’s Fair is FAIR: A Decentralised Future for WordPress Distribution
rmccue
0
180
なぜ強調表示できず ** が表示されるのか — Perlで始まったMarkdownの歴史と日本語文書における課題
kwahiro
12
6.1k
Featured
See All Featured
Done Done
chrislema
186
16k
[RailsConf 2023] Rails as a piece of cake
palkan
57
6.1k
The Art of Programming - Codeland 2020
erikaheidi
56
14k
Scaling GitHub
holman
463
140k
Designing for Performance
lara
610
69k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
33
1.8k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Balancing Empowerment & Direction
lara
5
750
Java REST API Framework Comparison - PWX 2021
mraible
34
9k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.2k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
36
6.1k
Into the Great Unknown - MozCon
thekraken
40
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!