LoginSignup
0
0

More than 3 years have passed since last update.

[sketch]電子工作で3つのLEDをチカチカしてみた件

Posted at

はじめに

今回は、やや稚拙なものかと思いまが、共有させて頂きます。
Arduino unoというマイコンボードを使って、はじめて電子工作してみました。

実際に動いている様子

IMG_0146.MOV.gif

gifなので、速度感が分かりにくいかもですが、こんな感じに動いてくれました。
やはり、動くと楽しい。

コード

void setup() {
  // put your setup code here, to run once:
  pinMode(11,OUTPUT);
  pinMode(12,OUTPUT);
  pinMode(13,OUTPUT);

}

void loop() {
  // put your main code here, to run repeatedly:
  digitalWrite(11,HIGH);
  digitalWrite(12,LOW);
  digitalWrite(13,LOW);

  delay(1000);

  digitalWrite(11,LOW);
  digitalWrite(12,HIGH);
  digitalWrite(13,LOW);

  delay(1000);

  digitalWrite(11,LOW);
  digitalWrite(12,LOW);
  digitalWrite(13,HIGH);

  delay(1000);

  digitalWrite(11,HIGH);
  digitalWrite(12,HIGH);
  digitalWrite(13,HIGH);

  delay(1000);
}

さいごに

不恰好かもしれませんが、備忘録も兼ねて保存させて頂きました。
なにかありましたら、コメントいただけると嬉しいです。

最後までありがとうございました。

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