const int buttonPin = 14;
int buttonState =0;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
pinMode(buttonPin, INPUT);
Serial.println("set up done!");
delay(1000);
}
void loop() {
buttonState = digitalRead(buttonPin);
if (buttonState ==HIGH){
Serial.println("Dang nhan nut");
} else {
Serial.println("Khong nhan nut");
}
// put your main code here, to run repeatedly:
}