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


沒有留言:

張貼留言

WOKWI LED + MQTT Node-Red SQLite

WOKWI LED + MQTT Node-Red SQLite const char *mqtt_broker = "broker.mqtt-dashboard.com" ; const char *topic1 = "alex9ufo/e...