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?

mBlockでArduino Unoのアナログ入力+Lチカ

0
Posted at

前の記事

Lチカ編

はじめに

mBlockを使ってArduino Uno制御をやってみた。

やりたいこと

アナログ入力をやってみる!

アナログ入力を基に内蔵のLEDを点滅させる

アナログ入力の状態にしたがって内蔵のLEDを点灯させる
アナログピン(A0)から読み取る

mblock_block_AIN.png

A0の読取値:解放時は1以上、グランドに落とすことで0(1以下)になる

1.解放時は1より上の時(>1の時)

内蔵LED(デジタルピン0)を高にする(消灯)

2.GNDとA0をつないだ時(0V)の時(>1ではない時)

内蔵LED(デジタルピン0)を低にする(点灯)

3.判定後

内蔵LED(デジタルピン0)を高にする(消灯)

0.5秒おきにアナログ状態から消灯の繰り返しを行う

最後に

CC BY-SA 4.0(著作者の情報とCCライセンス継承はお願いします。商用利用・改変・再配布は問題なし)です。

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?