Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Arduino kit required. Please show connections and code. Thank you Declare an integer variable for the pin number of the button pin, and set the

Arduino kit required. Please show connections and code. Thank youimage text in transcribedimage text in transcribedimage text in transcribed

Declare an integer variable for the pin number of the button pin, and set the value to 2 Declare an integer variable for the pin number of the DC motor first pin, and set the value to 3 Declare an integer variable for the pin number of the DC motor second pin, and set the value to 4. Declare an integer variable for the pin number of the distance sensor trig pin, and set the value to 5 Declare an integer variable for the pin number of the distance sensor echo pin, and set the value to 6 Declare an integer variable for the pin number of the LED pin, and set the value to 8. (The following global variables are used in the loop function and we need to track the previous loop values.) Declare an integer variable to track if the engine should rotate, and set the value to 0. (This variable will be modified by the program between 0stop and 1 start.) (The setup function runs once when you press reset.) void setup () (Reference the SainSmart UNO Starter Kits Tutorials, Chapter 3 Hello World! Open serial port, sets data rate to 9600 bps. (Reference the SainSmart UNO Starter Kits Tutorials, Chapter 4 LED Blink.) Set the variable for the pin number of the button pin to INPUT mode Set the variable for the pin number of the motor first pin to OUTPUT mode Set the variable for the pin number of the motor second pin to OUTPUT mode. Set the variable for the pin number of the trig pin to OUTPUT mode Set the variable for the pin number of the echo pin to INTPUT mode Set the variable for the pin number of the LED pin to oUTPUT mode. Write HIGH to digital pin number connected to the button pin.(The value reads 1 when the button is not pressed.) (The loop function runs over and over again forever.) void loop () Declare a local integer variable for storing the button value. Declare a local float variable for storing the measured distance value in cm Declare an integer variable for the pin number of the button pin, and set the value to 2 Declare an integer variable for the pin number of the DC motor first pin, and set the value to 3 Declare an integer variable for the pin number of the DC motor second pin, and set the value to 4. Declare an integer variable for the pin number of the distance sensor trig pin, and set the value to 5 Declare an integer variable for the pin number of the distance sensor echo pin, and set the value to 6 Declare an integer variable for the pin number of the LED pin, and set the value to 8. (The following global variables are used in the loop function and we need to track the previous loop values.) Declare an integer variable to track if the engine should rotate, and set the value to 0. (This variable will be modified by the program between 0stop and 1 start.) (The setup function runs once when you press reset.) void setup () (Reference the SainSmart UNO Starter Kits Tutorials, Chapter 3 Hello World! Open serial port, sets data rate to 9600 bps. (Reference the SainSmart UNO Starter Kits Tutorials, Chapter 4 LED Blink.) Set the variable for the pin number of the button pin to INPUT mode Set the variable for the pin number of the motor first pin to OUTPUT mode Set the variable for the pin number of the motor second pin to OUTPUT mode. Set the variable for the pin number of the trig pin to OUTPUT mode Set the variable for the pin number of the echo pin to INTPUT mode Set the variable for the pin number of the LED pin to oUTPUT mode. Write HIGH to digital pin number connected to the button pin.(The value reads 1 when the button is not pressed.) (The loop function runs over and over again forever.) void loop () Declare a local integer variable for storing the button value. Declare a local float variable for storing the measured distance value in cm

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

Business Process Driven Database Design With Oracle PL SQL

Authors: Rajeev Kaula

1st Edition

1795532386, 978-1795532389

More Books

Students also viewed these Databases questions

Question

How to find if any no. is divisble by 4 or not ?

Answered: 1 week ago

Question

Explain the Pascals Law ?

Answered: 1 week ago

Question

What are the objectives of performance appraisal ?

Answered: 1 week ago