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
82
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.4k
ファームウェアの Panic を 自動で収集・解析・分類・集計して 市場品質の改善サイクルを回す
hideakitai
1
1.4k
Other Decks in Programming
See All in Programming
EC2からECSへ 念願のコンテナ移行と巨大レガシーPHPアプリケーションの再構築
sumiyae
3
620
DevinとCursorから学ぶAIエージェントメモリーの設計とMoatの考え方
itarutomy
1
450
ChatGPT とつくる PHP で OS 実装
memory1994
PRO
3
190
AHC041解説
terryu16
0
510
traP の部内 ISUCON とそれを支えるポータル / PISCON Portal
ikura_hamu
0
230
[JAWS-UG横浜 #79] re:Invent 2024 の DB アップデートは Multi-Region!
maroon1st
0
120
DevFest - Serverless 101 with Google Cloud Functions
tunmise
0
140
ErdMap: Thinking about a map for Rails applications
makicamel
1
860
SpringBoot3.4の構造化ログ #kanjava
irof
1
180
2025.01.17_Sansan × DMM.swift
riofujimon
2
630
ISUCON14公式反省会LT: 社内ISUCONの話
astj
PRO
0
130
Amazon Nova Reelの可能性
hideg
0
240
Featured
See All Featured
Music & Morning Musume
bryan
46
6.3k
Building a Scalable Design System with Sketch
lauravandoore
460
33k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
11
890
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
45
2.3k
Building Flexible Design Systems
yeseniaperezcruz
328
38k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
Optimising Largest Contentful Paint
csswizardry
33
3k
Docker and Python
trallard
43
3.2k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
8
1.3k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
160
15k
A Modern Web Designer's Workflow
chriscoyier
693
190k
Rebuilding a faster, lazier Slack
samanthasiow
79
8.8k
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υϥΠόௐࢠѱ͍ʁΊͪΌॏ ͍ɻɻɻௐࠪதɻɻɻ
Ҏ্