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 作業2 RFID+Node-Red+Python+SQLite 練習 (修正版 利用wokwi 內部元件)

2026 作業2  RFID+Node-Red+Python+SQLite 練習 (修正版  利用wokwi 內部元件) 使用 wokwi 上 的 元件    (原先尚未有) 硬體線路   不需要 自行建立元件   rfid-rc522.chip.json   rfid-rc52...