Question: Please make code in Arduino for this scenario. Here's what I have so far. #include myDuino robot(1); int button1; int button2; int work = robot.encoderDir();
Please make code in Arduino for this scenario. Here's what I have so far.
#include 
Connect the rotary encoder, a DC motor and two momentary switches (long-arm or roller) to the Arduino development board. Use the readings from the encoder to control the duty cycle of the PWM signal to the DC motor. Each full rotation of the encoder should correspond to a 10% change in duty cycle (0100). In other words, if the program is started and then the encoder is turned one full rotation, the motor should be running at 10% duty cycle; after 10 rotations, the motor should be running at full speed. While one switch is held down, the motor should spin clockwise. While the other is held down, the motor should spin counterclockwise. When both or neither switches are held, the motor should not turn at all. Additionally, use the LEDs on the development board to indicate the direction of travel of the motor. One LED should illuminate when the motor is traveling CW and the other when the motor is traveling CCW
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
