const int DO_PIN = 32;
const int LED_PIN = 23;
const int potPin = 34;
int potValue = 0;
void setup() {
Serial.begin(115200);
pinMode(DO_PIN, INPUT);
pinMode(LED_PIN, OUTPUT);
digitalWrite(LED_PIN, LOW); }
void loop() {
int doState = digitalRead(DO_PIN);
potValue = analogRead(potPin);
Serial.print("DO trạng thái: ");
Serial.print(doState);
Serial.println();
Serial.println(potValue);
if (doState == LOW) {
digitalWrite(LED_PIN, HIGH);
} else {
digitalWrite(LED_PIN, LOW);
}
delay(1000);
}