2016年3月27日 星期日

//左移 跑馬燈

//左移 跑馬燈
//Shift Left LED  
const byte LEDs[] = {0,1,2,3,4,5,6,7};
const byte total = sizeof(LEDs);

void setup() 
{
  for (byte i=0; i<total; i++) 
  {
    pinMode(LEDs[i], OUTPUT);
  }
}


//=============================

void loop() {
  for (byte i=0; i<total; i++)
  {
    digitalWrite(LEDs[i], HIGH);
    delay (250);
    digitalWrite(LEDs[i], LOW);
    delay(250);
  }  // for
} //loop


沒有留言:

張貼留言

2026 作業1 MQTT基本觀念

 2026 作業1MQTT基本觀念 作業  參考下面網址 https://alex9ufoexploer.blogspot.com/2025/02/1-mqtt-relay-dht22-mqtt-box-pc-mymqtt.html https://alex9ufoexploer...