Question: Answer the following the questions based on the code snippet below: void loop ( ) i / / Set motor A speed and direction analogWirite

Answer the following the questions based on the code snippet below:
void loop() i
// Set motor A speed and direction
analogWirite (enA,150); // Speed control (0-255)
digitalWrite (inl, HIGH) ;
digitalWrite(in2, LOW);
// Set motor B speed and direction
analogWrite (enB,150); // Speed control (0-255)
digitalhrite(in3, HIGH);
digitalWrite(in4, 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 150 and the motors are spinning in the opposite directions.
 Answer the following the questions based on the code snippet below:

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!