const int row[3] = {
21,19,18
};
const int col[3] = {
33,25,26
};
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Hello, ESP32!");
for (int thisPin = 0; thisPin < 3; thisPin++) {
// initialize the output pins:
pinMode(col[thisPin], OUTPUT);
pinMode(row[thisPin], OUTPUT);
digitalWrite(col[thisPin], HIGH);
digitalWrite(row[thisPin], LOW);
}
}
void loop() {
for (int i = 0; i < 3; i++) {
digitalWrite(row[i],HIGH);
for (int j = 0; j < 3; j++) {
digitalWrite(col[j],LOW);
delay(100);
digitalWrite(col[j],LOW);
}
digitalWrite(row[i],LOW);
}
delay(0); // this speeds up the simulation
}