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
ofserial-option
Search
Hideaki Tai
December 13, 2015
Programming
0
81
ofserial-option
ofSerialで実装されていないシリアル制御のオプションを拡張
Hideaki Tai
December 13, 2015
Tweet
Share
More Decks by Hideaki Tai
See All by Hideaki Tai
Matter を Remo nano ではじめよう
hideakitai
0
2.2k
ファームウェアの Panic を 自動で収集・解析・分類・集計して 市場品質の改善サイクルを回す
hideakitai
1
1.4k
Other Decks in Programming
See All in Programming
讓數據說話:用 Python、Prometheus 和 Grafana 講故事
eddie
0
390
タクシーアプリ『GO』のリアルタイムデータ分析基盤における機械学習サービスの活用
mot_techtalk
4
670
Better Code Design in PHP
afilina
PRO
0
120
シールドクラスをはじめよう / Getting Started with Sealed Classes
mackey0225
3
430
JavaでLチカしたい! / JJUG CCC 2024 Fall LT
nhayato
0
120
Make Impossible States Impossibleを 意識してReactのPropsを設計しよう
ikumatadokoro
0
140
From Subtype Polymorphism To Typeclass-based Ad hoc Polymorphism- An Example
philipschwarz
PRO
0
200
Identifying User Idenity
moro
6
9.6k
What’s New in Compose Multiplatform - A Live Tour (droidcon London 2024)
zsmb
1
450
Amazon Qを使ってIaCを触ろう!
maruto
0
380
CSC509 Lecture 11
javiergs
PRO
0
180
シェーダーで魅せるMapLibreの動的ラスタータイル
satoshi7190
1
460
Featured
See All Featured
Embracing the Ebb and Flow
colly
84
4.5k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
231
17k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
26
2.1k
Designing the Hi-DPI Web
ddemaree
280
34k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
16
2.1k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
505
140k
The Invisible Side of Design
smashingmag
297
50k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
27
4.2k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
131
33k
Designing Experiences People Love
moore
138
23k
How to train your dragon (web standard)
notwaldorf
88
5.7k
Transcript
ϋʔυ͞ΜͱoF ofSerialͷ௨৴ΦϓγϣϯΛઃఆ͢Δ ୄ 2015.12.13
ϋʔυΣΞͱ௨৴͢Δͱݴ͑ γϦΞϧ௨৴Ͱ͢ΑͶ
γϦΞϧ௨৴େ͖Ͱ͢ΑͶʁ
ઌ͜ΜͳͭΛ࡞ͬͨͷͰ͕͢ɺɺɺ
ϞʔλυϥΠόͱ௨৴Ͱ͖ͳ͍
֬ೝͯ͠Έͨͱ͜Ζɺɺɺ • ύϦςΟνΣοΫ͕ۮͰೖͬͯΔʂ • oFઃఆ͠Α͏ʂ
None
͋Εɺɺɺ·͔͞ɺɺɺ Φϓγϣϯ͕ઃఆͰ͖ͳ͍ʂ
γϦΞϧͷΦϓγϣϯͱ දతͳͷɺϘʔϨʔτҎ֎ͩͱɺ • ύϦςΟ":"None,"Even,"Odd • ετοϓϏοτ":"1,"2 • σʔλϏοτ":"5,"6,"7,"8 • ϑϩʔ੍ޚ"(DTR)":"ON,"OFF
ͳͲ
Α͘͏IoTܥʁͷ(ͬ͞ͱ͑Δ)ػثͳΒɺ • ύϦςΟ":"None"(~PARENB) • ετοϓϏοτ":"1 • σʔλϏοτ":"8 • ϑϩʔ੍ޚ"(DTR)":"NONE ͱ͔ʹͳ͍ͬͯΔ
ࢀߟจݙ • γϦΞϧϙʔτͰ༡΅͏ • γϦΞϧ௨৴ͷجૅࣝ"#"RS#232C"/"RS#422"/"RS#485"
oFͰ͍ͬͯΔγϦΞϧͷϥΠϒϥϦ • TERMIOS)(LINUXඪ४ͷλʔϛφϧ੍ޚΠϯλϑΣʔεΈ͍ͨ) • ຊޠͷManPage
͜ͷΜ͍͡Ε͍͍ͬΆ͍
֦ுͯ͠Έ·ͨ͠ class ofxSerial : public ofSerial { void setParity(parity p);
void setStopBits(stop_bits s); void setDataBits(data_bits d); };
ςετͯ͠Έ·͠ΐ͏ ͱΓ͋͑ͣArduinoઌੜͰ
ArduinoઌੜͰ͜Μͳײ͡Ͱఆٛ͞Εͯͨ
ͯ͜ͱͰɺ͜Μͳײ͡Ͱॻ͚OK void setup() { Serial.begin(9600, SERIAL_8E2); // ϘʔϨʔτͱΦϓγϣϯͷઃఆ } void
loop() { while (Serial.available()) { Serial.print("got message! : "); Serial.println((int)Serial.read()); } }
γϦΞϧ௨৴࠷ߴʂ γϦΞϧ௨৴ͭΒ͍
ͱΓ͋͑ͣެ։ • ͪ͜Βɿh#ps:/ /gist.github.com/hideakitai/ b4eb28a4ee8b04d3cce0 • ofxSerial͍ͬͯ͏ଞϥΠϒϥϦΛͬͨͭ • ϝϯς͞Εͯͳ͍༷Ͱͬͨ͜ͱແ͍Ͱ͢
ࠓޙ • El$CapitanͷγϦΞϧɺFTDIυϥΠόௐࢠѱ͍ʁΊͪΌॏ ͍ɻɻɻௐࠪதɻɻɻ
Ҏ্