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
JavaScript と Arduino でオリジナルデバイスを作ろう
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Yoshihiro Iwanaga
February 27, 2014
Technology
98
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
JavaScript と Arduino でオリジナルデバイスを作ろう
http://atnd.org/events/47308
Yoshihiro Iwanaga
February 27, 2014
Transcript
40 slides
JavaScript と Arduino で オリジナルデバイスを作ろう html5j エンタメ技術部 第1回勉強会
話者 @y_iwanaga_ @quake_alert テレビより早い 地震速報
• ⾃自分で回路路を組み、 • ⾃自分のコードで操る 30分後: オリジナルデバイスを作れる状態
Arduino の役割:1. 出⼒力力 電流流を供給されて光る 電圧を発⽣生させる
センサーの 抵抗変化・電流流発⽣生 電圧を読み取る Arduino の役割:2. ⼊入⼒力力 0 V 〜~ 5V
→ 0 〜~ 1023 or 0, 1 に変換
必要な材料料 個別に買うのは⾯面倒くさい。キットを買えばいい。
(TechShare) 必要⼗十分なパーツ。安い。 Amazon で注⽂文し、2 ⽇日後に届いた。 Arduino エントリーキット オススメ
この後の流流れ • Arduino 基礎知識識 • 電⼦子回路路の組み⽅方 • ⾃自分のプログラムと連携させる⼿手順 • 応⽤用例例
この後の流流れ • Arduino 基礎知識識 • 電⼦子回路路の組み⽅方 • ⾃自分のプログラムと連携させる⼿手順 • 応⽤用例例
None
ここに USB ケーブルを挿して、PC とつなぐ
DIGITAL I/O 電圧をかける or 読み取る。
L, TX, RX インジケータ
GND 出⼒力力の終端をここにつなぐ。
Analog In 電圧値を細かく読み取りたいときはココに。
Power シールドに電源を供給するときはココから。
Reset ボタン 初期状態に戻したいときにプッシュ!
この後の流流れ • Arduino 基礎知識識 • 電⼦子回路路の組み⽅方 • ⾃自分のプログラムと連携させる⼿手順 • 応⽤用例例
Breadboard
Breadboard
例例
鉄の掟 パーツの 許容電流流 を守る。
過電流流が流流れて
こうなります。
使うべき抵抗値 [流流す電流流] [電源の電圧] − [パーツに加える電圧] = 電流流は抵抗で調節すればいい。 5 V 固定
パーツの仕様書で調べる ⇒ パーツが決まれば、⾃自動的に決まる。
この後の流流れ • Arduino 基礎知識識 • 電⼦子回路路の組み⽅方 • ⾃自分のプログラムと連携させる⼿手順 • 応⽤用例例
概要 Firmata protocol StandardFirmata
JavaScript ライブラリ johnny-five CylonJS
この後の流流れ • Arduino 基礎知識識 • 電⼦子回路路の組み⽅方 • ⾃自分のプログラムと連携させる⼿手順 • 応⽤用例例
回路路
コード var j5 = require('johnny-five'), arduino = new j5.Board(); arduino.on('ready',
function(){ var led = new j5.Led({ pin: 13 }); led.strobe(200); });
デモ
スイッチの ON/OFF を拾拾う
var j5 = require('johnny-five'), arduino = new j5.Board(); arduino.on('ready', function(){
var button = new j5.Button({ pin: 2, holdtime: 2000 }); button.on('down', function(){ console.log('button - on'); }); button.on('up', function(){ console.log('button - released'); }); button.on('hold', function(){ console.log('button - hold'); }); });
デモ
LEDとスイッチの組み合わせ
デモ
⾯面⽩白そうなネタ • IR レシーバ – リモコン操作 • ガスセンサー – おなら検知 ⇒
LED や Twitter で盛⼤大に通知 • ⼟土壌湿度度センサー – ⽔水やり時期を教えてもらう
良良い情報源 抵抗の⾒見見分け⽅方 http://part.freelab.jp/s_regi_list.html 回路路の作り⽅方 http://arduino.cc/en/Tutorial
今回の詳細 コード・回路路図はココからどうぞ。 github.com/ iwanaga/arduino-‐‑‒test
More Decks by Yoshihiro Iwanaga
See All by Yoshihiro Iwanaga
HTTP2 最速実装v2
yoshi
0
150
Anomaly Detection by Mean and Standard Deviation
yoshi
0
190
WebComponents LT at AQ
yoshi
0
79
MHTML LT at AQ
yoshi
2
68
HOTATE (Developers Summit 2012)
yoshi
0
47
Anomaly detection using correlations of load
yoshi
0
70
Other Decks in Technology
See All in Technology
Platform Engineering をベースとした Agentic Software Factory の実践
110y
3
1k
Amazon Bedrock AgentCore の基礎とセキュリティ・ガバナンス
ren8k
0
290
みん強Lightning! データ基盤ひとりでできるかな
endonanana
0
220
【Oracle AI SPOTLIGHT ウェビナー】AI時代、狙われるデータと止められない業務をどう守るか?
oracle4engineer
PRO
1
160
社内アプリ基盤「Quartz」による、 非エンジニアとAIに本番デプロイを 任せても壊れないプラットフォームの設計
staka121
PRO
1
260
技術同人誌を作る方法
yoshimura_datam
0
100
AWS DevOps Agentの構造から読み解く運用 AI エージェントの設計原則/aws-devops-agent-design-principles
tomoki10
0
310
OSSとミニPCと私
anatofuz
1
110
AWS Well-Arhitected Frameworkセキュリティの柱 について
miu_crescent
PRO
2
260
New Relicのアラート対応をClaude Codeで自動修正するワークフローを作った話
manabuseki
3
740
[DBRE Summit 26] DBRE はデータベース運用をどう変えたのか
_awache
0
140
AI時代のTechLeadの問い〜Tech Lead Conference 2026 Autumn / questions-for-tech-leads-in-the-age-of-ai
haru860
0
100
Featured
See All Featured
The Cost Of JavaScript in 2023
addyosmani
56
10k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
Done Done
chrislema
187
17k
Heart Work Chapter 1 - Part 1
lfama
PRO
11
37k
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.5k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
1
680
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
1
250
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.7k
Designing for Timeless Needs
cassininazir
1
570
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Code Reviewing Like a Champion
maltzj
529
40k
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.8k