Question: Answer the following the questions based on the code snippet below: void loop ( ) { ? ? ? Set motor A speed and direction
Answer the following the questions based on the code snippet below:
void loop
Set motor A speed and direction
analogWrite enA; Speed control
digitalWrite in HIGH ;
digitalWritein LOW;
Set motor B speed and direction
analogWrite enB; Speed control
digitalWrite in HIGH ;
digitalWrite in LOW ;
a Create a variable called motorSpeed that will store the speed of the dc motors. Rewrite the code
above so that the variable is substituted for the value and the motors are spinning in the
opposite directions.
b Create a second variable motorSpeed Using motorSpeed and motorSpeed modify the code so
that the motor B spinning at twice the speed of motor A in the same direction.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
