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
72
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
1.8k
ファームウェアの Panic を 自動で収集・解析・分類・集計して 市場品質の改善サイクルを回す
hideakitai
1
1.3k
Other Decks in Programming
See All in Programming
ぼっちを避けて楽しむためのアノテコノテ / Various Tips and Tricks to Avoid Loneliness and Have Fun
nrslib
3
1.7k
Exploring the Gradually Lost Technical Skills in the Cloud Native Era
hwchiu
2
3.9k
CSC307 Lecture 10
javiergs
PRO
0
310
ドメイン駆動設計の実践
masuda220
PRO
19
5.2k
DMMプラットフォームにおけるTiDBの導入から運用まで
pospome
7
3k
最近追加した型の紹介とその振り返り
aki19035vc
0
180
君たちはどうコードをレビューする (される) か / 大吉祥寺.pm
utgwkk
15
8.5k
feature環境をGitHub ActionsとCloudFormationでいい感じに管理する
nealle
2
310
日付と正規化
megmogmog1965
0
140
DynamoDB コスト最適化っぽいことの基本 with Terraform
kuro_kurorrr
2
250
AWSでゲームサーバーを運用! Amazon GameLiftのお話
iriikeita
0
200
SRE チーム立ち上げ前に考えたこと・取り組んだこと / Considerations and Preparations Before Establishing an SRE Team
mackey0225
3
320
Featured
See All Featured
Mobile First: as difficult as doing things right
swwweet
219
8.8k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
16
1.6k
What's in a price? How to price your products and services
michaelherold
239
11k
[RailsConf 2023] Rails as a piece of cake
palkan
35
4.4k
Facilitating Awesome Meetings
lara
46
5.8k
The World Runs on Bad Software
bkeepers
PRO
63
11k
10 Git Anti Patterns You Should be Aware of
lemiorhan
652
58k
The Cost Of JavaScript in 2023
addyosmani
31
4.7k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
29
2.5k
In The Pink: A Labor of Love
frogandcode
139
22k
Designing on Purpose - Digital PM Summit 2013
jponch
113
6.6k
Building Effective Engineering Teams - LeadDev
addyosmani
47
2.2k
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υϥΠόௐࢠѱ͍ʁΊͪΌॏ ͍ɻɻɻௐࠪதɻɻɻ
Ҏ্