/*
* Blink LED with ESP-12
*/
int pins[] = { 0, 2, 4, 5, 12, 13, 14, 15, 16 };
int numpins;
void setup() {
delay(1000);
Serial.begin(9600);
numpins=sizeof(pins)/4;
Serial.print("Start numpins=");
Serial.println(numpins);
for (int i=0;i<numpins;i++) {
pinMode(pins[i], OUTPUT);
digitalWrite(pins[i], LOW);
}
}
void loop() {
static int pin=0;
Serial.print("pin=");
Serial.println(pins[pin]);
for (int i=0;i<numpins;i++) {
digitalWrite(pins[i], LOW);
}
digitalWrite(pins[pin], HIGH);
pin++;
if (pin == numpins) pin=0;
delay(1000);
}
|