Question: const int switchPin = 2 ; int switchState = - 1 ; / / * void setup ( ) { Serial.begin ( 1 1 5

const int switchPin =2; int switchState =-1; //* void setup(){ Serial.begin(115200); pinMode(switchPin, INPUT); digitalWrite(switchPin, HIGH); } void loop(){ switchState = digitalRead(switchPin); Serial.println(switchState); delay(10); } Question 3[3 marks] In the above code for a microswitch, what does the line commented with a * do? A. Decreases the value of switchState from 2 to 1 B. Activates a pull-up resistor on pin -1 C. Initialises switchState to an impossible value before reading D. Converts the value read in on switchPin from analogue to digital

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Electrical Engineering Questions!