11
11

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.

Arduinoの基礎知識

Last updated at Posted at 2012-02-25

Arduinoとは

ハードとソフトにまたがった開発環境
とにかくEasy(になるように設計されている)
twitter@anywhereでログインボタンを設置するよりも、Arduinoつかって光センサの値を取得してLEDに反映させる方が簡単
はんだづけ不要
言語はprocessing。アホみたいに簡単。

記述例

ここでは、光センサから読み取った値をもとにLEDの光度を調節している

# define LED 9//LEDを9の定数とする
int val = 0;

void setup()
{
  pinMode(LED, OUTPUT);//LEDをアウトプットに設定
}


void loop()
{
  val = analogRead(0);//アナログピン0番から電圧を読み取る 0~1023の間の値がセットされる
  analogWrite(LED,val/4);//LEDのピンに値を書きこむ(光らせる)
  delay(10);
}
11
11
1

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
11
11

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?