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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
C J Silverio
November 15, 2013
Programming
410
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
330
Keeping JavaScript safe
ceejbot
3
500
ceej's how to solve it
ceejbot
6
780
work-life balance at npm
ceejbot
5
810
hash functions and you!
ceejbot
2
390
The accidental noder
ceejbot
2
180
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
30年振りにコンパイラの定数整数除算を改善した
herumi
9
4.4k
PyO3 で既存 Python 評価器を Rust core 化する ー wasm-bindgen でブラウザにも配るための設計
kdash
1
390
Pythonの実行はどこまで賢くなったのか? CPythonとPyPyから見る最適化のしくみ
curekoshimizu
4
2.8k
まだ間に合う!今年の夏こそSchemeのマクロ展開器を完全理解!
omasanori
0
630
ALB ログから Trace を気合で繋げる技術
fohte
7
870
Claude Codeを組織的に動かして月400PRを実現した話
happy_ryo
0
250
MySQLとPostgreSQLって何が違うの?
akagami
PRO
0
160
書籍「プロフェッショナルAI駆動開発」紹介スライド
juntaromatsumoto
0
980
AIを上手に使っていこうとしたら越境せざるを得なくなった話 〜実践1年で見えた境界を越えなければならない理由と進め方〜 / Crossing borders with AI
tomoyakitaura
3
1k
The Good Stuff, Not the Slop: Engineering High-Quality Android Apps with Modern AI Tooling
danybony
1
180
LLMは4年分のCompose移行を再現できるのか?実プロダクト279件のXMLで探る自動化の境界線
makun
0
380
異なる設計思想のフレームワークを経験して得た学び
amekuhideki
2
1.5k
Featured
See All Featured
The Spectacular Lies of Maps
axbom
PRO
1
970
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.6k
So, you think you're a good person
axbom
PRO
2
2.1k
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
2
3.8k
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
190
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
520
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
590
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
510
4 Signs Your Business is Dying
shpigford
187
23k
Prompt Engineering for Job Search
mfonobong
0
440
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.5k
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
2
660
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!