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


沒有留言:

張貼留言

Node-Red Dashboard UI Template + AngularJS 參考 AngularJS教學 --3

  Node-Red Dashboard UI Template + AngularJS 參考 AngularJS教學 --3 AngularJS 實例 <!DOCTYPE html> <html> <head> <meta charse...