2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

C#(Serial.IO.Ports)とラズピコ間でシリアル通信が出来ない

Last updated at Posted at 2024-01-20

発生した問題

Raspberry Pi Picoから垂れ流した通信が,C#(Serial.IO.Ports)のReadLineで取得できない.
シリアル通信のOpenはできていて,GetPortsでポートナンバーも取得できていたのに受信のみができない.
(できてはいるみたいだがConsoleに出しても何も表示されない)

解決方法

program.cs
SerialPort serial = new SerialPort(portName, baurate, Parity.None, 8, StopBits.One);
serial.DtrEnable = true;
serial.Open();

上記のように,DtrEnableプロパティをtrueにしてからOpenする.
最近発売されたArduino Rev4でこの問題が起こるという以下の記事を見つけもしかしたらと思いやってみたらビンゴ.
https://qiita.com/mag2/items/d15bc3c9d66ce0c8f6b1)
ラズピコも割と新しいマイコンだし,最近発売されたマイコン使ってる人は同じことが起きているかも?

あとがきと愚痴

最近Unityの勉強をしていて,Unity内で通信できなくて悩んでいました.
今更シリアル通信で躓くと思ってなかったので,Unity側で何か自分がミスってるのかと調べまくったり友人に聞いたり,でもなかなか解決しなかった,,
この問題,エラーとかでないから性質が悪い

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?