Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Four LEDs, two DC Motors and a voltmeter (along with appropriate resistors as needed) are connected to an Arduino. The following code will be executed

Four LEDs, two DC Motors and a voltmeter (along with appropriate resistors as needed) are connected to an Arduino. The following code will be executed on the Arduino.

Arduino Uno Code:

void setup()

{

pinMode(12, OUTPUT);

pinMode(4, OUTPUT);

pinMode(2, OUTPUT);

pinMode(13, OUTPUT);

digitalWrite(12, HIGH);

digitalWrite(4, HIGH);

digitalWrite(2, HIGH);

digitalWrite(13, HIGH);

}

void loop()

{

delay(2000);

digitalWrite(4, LOW);

delay(2000);

digitalWrite(2, LOW);

delay(2000);

digitalWrite(12, LOW);

delay(2000);

digitalWrite(13, LOW);

delay(2000);

digitalWrite(4, HIGH);

delay(2000);

digitalWrite(2, HIGH);

digitalWrite(13, HIGH);

digitalWrite(12, HIGH);

}

When the sketch is run, the system will go through a 12-second cycle as shown in Table 1 and continue repeating the pattern. In the ON state, the LEDs can have any brightness as long theyre visibly ON. When turned on, Motor-1 rotates only clockwise (with a positive rpm) and Motor-2 rotates only counter-clockwise (with a negative rpm). The voltmeter reading should be close to 2 V if not exactly 2 V (Hint: use a voltage divider).

image text in transcribed

image text in transcribed

Once you determine what the connections are, run the sketch and confirm that it properly goes through the six states periodically as listed in Table 1.

In your report, include a clear screenshot of the circuit connections when the system is in State-2. Specify the resistor values you used.

Hardware or Software platform for solution is fine!
Motor 1 Motor 2 Red LED Green LED ON Yellow LED Voltmeter Reading ON ON 2V ON ON OFF ON Blue LED ON ON ON OFF OFF ON ON 2 V ON ON OFF OFF State 1: 0 to 2 sec State 2:2 to 4 sec State 3: 4 to 6 sec State 4: 6 to 8 sec State 5: 8 to 10 sec State 6: 10 to 12 sec 2 V OFF OFF OFF OFF OFF OFF 2V OFF OFF OFF ON ON OFF OFF OV ON OFF OFF OFF OFF OV Table1 Figure 7 shows the status of the system in State-1, ie, during the first 2 seconds. The connections of these components to the Arduino and the required resistors are hidden. Examine the sketch and find out what these connections should be. 2.00 V POWER ANALOG IN Figure 7 Motor 1 Motor 2 Red LED Green LED ON Yellow LED Voltmeter Reading ON ON 2V ON ON OFF ON Blue LED ON ON ON OFF OFF ON ON 2 V ON ON OFF OFF State 1: 0 to 2 sec State 2:2 to 4 sec State 3: 4 to 6 sec State 4: 6 to 8 sec State 5: 8 to 10 sec State 6: 10 to 12 sec 2 V OFF OFF OFF OFF OFF OFF 2V OFF OFF OFF ON ON OFF OFF OV ON OFF OFF OFF OFF OV Table1 Figure 7 shows the status of the system in State-1, ie, during the first 2 seconds. The connections of these components to the Arduino and the required resistors are hidden. Examine the sketch and find out what these connections should be. 2.00 V POWER ANALOG IN Figure 7

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_2

Step: 3

blur-text-image_3

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

A Course In Derivative Securities

Authors: Kerry Back

2005th Edition

3540253734, 978-3540253730

More Books

Students also viewed these Finance questions

Question

Discuss the general principles of management given by Henri Fayol

Answered: 1 week ago

Question

Detailed note on the contributions of F.W.Taylor

Answered: 1 week ago