Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions