1
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 5 years have passed since last update.

Processing > int型をstr型に変換する > str()

Last updated at Posted at 2016-07-16
動作環境
Processing 3.1.1 on Windows 8.1 pro(64bit)

ソフト起動時からの経過時間をCOMポート経由で送信する時に、int型をstr型に変換する必要がある。

変換はstr()を使うようだ。
http://www.musashinodenpa.com/p5/index.php?pos=291

例として、以下のようにするとソフト起動時からの経過時間と付随文字列がretに格納される。

int elapsed_sec = millis() / 1000; 
String ret = str(elapsed_sec);
ret = ret + ",3.14, 2.71, 6.022, 1023\r\n";
1
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
1
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?