const int l1 = 2;
const int l2 = 4;
int l1_state = 1;
int l2_state = 0;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Hello, ESP32!");
pinMode(l1, OUTPUT);
pinMode(l2, OUTPUT);
digitalWrite(l1, l1_state);
digitalWrite(l2, l2_state);
}
void loop() {
// put your main code here, to run repeatedly:
// doc trang thai tai 2 chan
l1_state = digitalRead(l1);
l2_state = digitalRead(l2);
digitalWrite(l1, !(l1_state));
digitalWrite(l2, !(l2_state));
delay(500);
delay(10); // this speeds up the simulation
}