0
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 3 years have passed since last update.

arduinoの中の電卓をつかおう!!

Last updated at Posted at 2020-04-08

以前Arduinoはスケッチ+電圧計+電卓という話をしました。
そこで今回はarduino内の電卓を使っていこうと思います。

#プログラム

keisan.ino
void setup(){
Serial.begin(9600);
Serial.print("5+5=");Serial.println(5+5);
Serial.print("5-5=");Serial.println(5-5);
Serial.print("5*5=");Serial.println(5*5);
Serial.print("5/5=");Serial.println(5/5);
Serial.print("5%5=");Serial.println(5%5);
}
void loop(){
}

解説:
「+」で足し算
「-」で引き算
「*」で掛け算
「/」で割り算
「%」では割り算のあまり
になっています。

#結果
シリアルモニターを開くと計算結果が表示されていると思います。
以上です、お疲れさまでした。

0
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
0
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?