Thành Nguyễn
New member
How many times will the following loop run if the input to the code is a constant 5V signal?
A. 1
B. 2
C. infinitely
D. 5
Code:
int pin1=10;
void setup() {
Serial.begin(9600);
pinMode(pin1,INPUT);
}
void loop() {
for(int i=0;i<10;i--) {
if(digitalRead(pin1)==1) {
Serial.println(“HELLO”);
}
}
}
B. 2
C. infinitely
D. 5