WeMos (2) 3色LED表示

3色LEDをつないて、順次点滅する。

 

#define LEDR 12
#define LEDG 13
#define LEDB 14

void setup() 
{
  pinMode(LEDR, OUTPUT);
  pinMode(LEDG, OUTPUT);
  pinMode(LEDB, OUTPUT);
}

void loop() 
{
  digitalWrite(LEDR, HIGH);
  delay(1000);
  digitalWrite(LEDG, HIGH);
  delay(1000);
  digitalWrite(LEDB, HIGH);
  delay(1000);
  digitalWrite(LEDR, LOW);
  delay(1000);
  digitalWrite(LEDG, LOW);
  delay(1000);
  digitalWrite(LEDB, LOW);
  delay(1000);
}

 

Leave a Reply

Your email address will not be published. Required fields are marked *