void setup() {
// put your setup code here, to run once:
pinMode(2,INPUT_PULLUP);
pinMode(3,INPUT_PULLUP);
Serial.begin(115200);
Serial.println("ชื่อนักเรียน ");
}
int x=0; //ประกาศตัวแปร x และกำหนดค่าเริ่มต้นให้ x มีค่าเป็น 0
void loop() {
// put your main code here, to run repeatedly:
if(digitalRead(3)==LOW){
for(int x=1;x<=10;x++){
Serial.print(x);
Serial.println(" รหัส");
}
while(digitalRead(3)==LOW){
delay(10);
}
delay(10);
}
if(digitalRead(2)==LOW){
for(int x=1;x<=10;x++){
Serial.print(x);
Serial.println(" ชื่อนักเรียน");
}
while(digitalRead(2)==LOW){
delay(10);
}
delay(10);
}
}