Arduino程式碼
const byte LED1 = 8; const byte LED2 = 9; const byte LED3 = 10; void setup() { pinMode(LED1, OUTPUT); pinMode(LED2, OUTPUT); pinMode(LED3, OUTPUT); } void loop() { setLEDs(HIGH, LOW, LOW); delay(100); setLEDs(LOW, HIGH, LOW); delay(100); setLEDs(LOW, LOW, HIGH); delay(100); } void setLEDs(byte led1, byte led2, byte led3) { digitalWrite(LED1, led1); digitalWrite(LED2, led2); digitalWrite(LED3, led3); }
程式碼ino檔
github下載