Nguyễn Trọng Tân
New member
What is the value of “val” in the following program if the pin 12 is given 5V 3 times?
A. null
B. 113
C. 3
D. 2
Code:
int val=0;
void setup() {
Serial.begin(9600);
PinMode(13,INPUT);
}
void loop() {
int s = digitalRead(13);
if(s==1){
val=val+1;
}
}
B. 113
C. 3
D. 2