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
Workshops On Designing Electronic Toys #11
Search
Hirotaka Nakajima
June 17, 2014
0
130
Workshops On Designing Electronic Toys #11
Hirotaka Nakajima
June 17, 2014
Tweet
Share
More Decks by Hirotaka Nakajima
See All by Hirotaka Nakajima
暗号資産カストディアンとセキュリティ
nunnun
0
64
W3Cについて - インターネット標準勉強会 - 若者編
nunnun
0
630
プロフェッショナルSSL/TLS勉強会 PKIに対する攻撃 (第4章)
nunnun
0
1.4k
Paper Summary Encore: Lightweight Measurement of Web Censorship with Cross- Origin Requests
nunnun
0
140
インターネット -第10回- Firefox OSアプリ開発 応用編
nunnun
0
890
Introduction to Server Operations and Automations
nunnun
1
250
Exploring the knowledge on Web
nunnun
2
88
インフラエンジニアのための次世代プロトコル入門 - July TechFesta 2014
nunnun
36
12k
Workshops On Designing Electronic Toys #10
nunnun
0
160
Featured
See All Featured
Building a Modern Day E-commerce SEO Strategy
aleyda
38
7k
The Invisible Side of Design
smashingmag
298
50k
4 Signs Your Business is Dying
shpigford
181
21k
We Have a Design System, Now What?
morganepeng
51
7.3k
Documentation Writing (for coders)
carmenintech
66
4.5k
Navigating Team Friction
lara
183
15k
How to Ace a Technical Interview
jacobian
276
23k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
48
2.2k
A Philosophy of Restraint
colly
203
16k
Visualization
eitanlees
146
15k
A Tale of Four Properties
chriscoyier
157
23k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
111
49k
Transcript
5IFTFTMJEFTBSFDPQZSJHIU)JSPUBLB/BLBKJNB3FEJTUSJCVUFBOEEJTDMPTVSFPGUIFTFTMJEFTBSFOPUQFSNJUUFEXJUIPVUQFSNJTTJPOT ,FJP6OJWFSTJUZMPHPJTMJDFOTFECZJUTDPQZSJHIUIPMEFST Workshops On Designing Electronic Toys #11 Hirotaka Nakajima
/ @nunnun http://about.me/nunnun 1
5IFTFTMJEFTBSFDPQZSJHIU)JSPUBLB/BLBKJNB3FEJTUSJCVUFBOEEJTDMPTVSFPGUIFTFTMJEFTBSFOPUQFSNJUUFEXJUIPVUQFSNJTTJPOT ,FJP6OJWFSTJUZJTMJDFOTFECZJUTDPQZSJHIUIPMEFST Agenda 2 • Using I2C Sensor • Work
time
5IFTFTMJEFTBSFDPQZSJHIU)JSPUBLB/BLBKJNB3FEJTUSJCVUFBOEEJTDMPTVSFPGUIFTFTMJEFTBSFOPUQFSNJUUFEXJUIPVUQFSNJTTJPOT ,FJP6OJWFSTJUZJTMJDFOTFECZJUTDPQZSJHIUIPMEFST Sensors 3 • Kind • Temperature / Humidity
• Gyroscope / Accelerometer • Photo sensor (LED sensor) • Pressure • Way to connect • Analog • Digital • I2C
5IFTFTMJEFTBSFDPQZSJHIU)JSPUBLB/BLBKJNB3FEJTUSJCVUFBOEEJTDMPTVSFPGUIFTFTMJEFTBSFOPUQFSNJUUFEXJUIPVUQFSNJTTJPOT ,FJP6OJWFSTJUZJTMJDFOTFECZJUTDPQZSJHIUIPMEFST I2C 4 • Inter-Integrated Circuit • Bus spec
for internal device communication • Bus speed: 100kbps, 400kbps ~ 3.4Mbps • Shared 2 physical pins for I/O • Clock signal (SCL) • Data transfer (SDA) • 10k pull-up resistor • Master-Slave model • Binary protocol
5IFTFTMJEFTBSFDPQZSJHIU)JSPUBLB/BLBKJNB3FEJTUSJCVUFBOEEJTDMPTVSFPGUIFTFTMJEFTBSFOPUQFSNJUUFEXJUIPVUQFSNJTTJPOT ,FJP6OJWFSTJUZJTMJDFOTFECZJUTDPQZSJHIUIPMEFST I2C 5 • 1. Start bit (1 bit)
• 2. Slave Address (7 bits) • 3. Read / Write flag • 4. Acknowledgement (1 bit) from slave • 5. Data (8 bits) • 6. Data-Acknowledgement (1 bit) from slave • 7. Stop bit (1 bit) Chart: http://nora66.com/avr/prog2.html
5IFTFTMJEFTBSFDPQZSJHIU)JSPUBLB/BLBKJNB3FEJTUSJCVUFBOEEJTDMPTVSFPGUIFTFTMJEFTBSFOPUQFSNJUUFEXJUIPVUQFSNJTTJPOT ,FJP6OJWFSTJUZJTMJDFOTFECZJUTDPQZSJHIUIPMEFST I2C 6 • 1. Start bit (1 bit)
• 2. Slave Address (7 bits) • 3. Read / Write flag • 4. Acknowledgement (1 bit) from slave • 5. Data (8 bits) from slave • 6. Data-Acknowledgement (1 bit) • 7. Stop bit (1 bit) Chart: http://nora66.com/avr/prog2.html
5IFTFTMJEFTBSFDPQZSJHIU)JSPUBLB/BLBKJNB3FEJTUSJCVUFBOEEJTDMPTVSFPGUIFTFTMJEFTBSFOPUQFSNJUUFEXJUIPVUQFSNJTTJPOT ,FJP6OJWFSTJUZJTMJDFOTFECZJUTDPQZSJHIUIPMEFST I2C with Arduino 7 • Arduino I2C support:
Wire http://www.arduino.cc/en/Reference/Wire • Lots of libraries for sensors • Today we will use GY-80 • L3G4200D (3 axis gyro) • ADXL345 (3 axis accelerometer) • HMC5883L (compass) • BMP085 (temperature & pressure sensor)
5IFTFTMJEFTBSFDPQZSJHIU)JSPUBLB/BLBKJNB3FEJTUSJCVUFBOEEJTDMPTVSFPGUIFTFTMJEFTBSFOPUQFSNJUUFEXJUIPVUQFSNJTTJPOT ,FJP6OJWFSTJUZJTMJDFOTFECZJUTDPQZSJHIUIPMEFST I2C with Arduino 8 • http://web.sfc.keio.ac.jp/~takefuji/gy80.tar • pin
• Arduino: A4 (SDA), A5 (SCL) • GY-80: SCL, SDA
5IFTFTMJEFTBSFDPQZSJHIU)JSPUBLB/BLBKJNB3FEJTUSJCVUFBOEEJTDMPTVSFPGUIFTFTMJEFTBSFOPUQFSNJUUFEXJUIPVUQFSNJTTJPOT ,FJP6OJWFSTJUZJTMJDFOTFECZJUTDPQZSJHIUIPMEFST 9
5IFTFTMJEFTBSFDPQZSJHIU)JSPUBLB/BLBKJNB3FEJTUSJCVUFBOEEJTDMPTVSFPGUIFTFTMJEFTBSFOPUQFSNJUUFEXJUIPVUQFSNJTTJPOT ,FJP6OJWFSTJUZJTMJDFOTFECZJUTDPQZSJHIUIPMEFST 2VFTUJPO $PNNFOUT IJSP!BXBTGDLFJPBDKQ IUUQBCPVUNFOVOOVO !OVOOVO 10