LoginSignup
0
2

More than 5 years have passed since last update.

Arduino > link > double型をchar型に変換する > dtostrf()

Posted at
動作環境
Arduino IDE 1.6.6
ESP8266実装機版 (ユニバーサル基板)

MPU-9250からQuaternionの値を取得しようとしている。
取得済のデータ(double)からUDP通信用にchar型に変換が必要だった。

https://stackoverflow.com/questions/19867227/convert-double-type-into-string-type-in-arduino-sketch
に記載のdtostrf()を使ったところ、char型に変換できた。

Quaternionのx成分だけの通信。

<PyQt5.QtNetwork.QHostAddress object at 0x7f295f16c828>
qtn,0.51,,

<PyQt5.QtNetwork.QHostAddress object at 0x7f295f16c898>
qtn,0.53,,

<PyQt5.QtNetwork.QHostAddress object at 0x7f295f16c828>
qtn,0.43,,

<PyQt5.QtNetwork.QHostAddress object at 0x7f295f16c898>
qtn,0.23,,
0
2
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
0
2