Question: Problem 9 . 1 : The following Arduino code is designed to turn on the onboard LED whenever a push button is pressed, but there

Problem 9.1: The following Arduino code is designed to turn on the onboard LED whenever a push button is pressed, but there are four errors that will prevent the code from working properly. On which lines are the four errors located? Select all that apply.
1: int pushButton =2;
2: int ledPin =8;
3:
4: void setup(){
5: Serial.begin(9600);
6: pinMode(pushButton, OUTPUT);
7: pinMode(ledPin, INPUT);
8: }
9:
10: void loop(){
11: int buttonState = digitalRead(pushButton);
12: digitalwrite(ledPin,buttonState);
13: Serial.println(buttonState);
14: delay(10);
15: }

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 Databases Questions!