Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using the PWM module, write a program to operate the motor as follows; when the on- board button is pressed, the red on-board LED should

image text in transcribed
image text in transcribed
Using the PWM module, write a program to operate the motor as follows; when the on- board button is pressed, the red on-board LED should flash 5 times with a 0-5 second on-time and a 0.5 second off-time. lDnce the LED flashes 5 times, the motor should operate in the forward direction with a 100% duty cycle. When the on-board button is pressed again, the motor should stop first, then the on-board LED should flash 5 times with a 0-5 second on-time and a 0.5 second off-time. The motor should then operate in the reyerse direction with a 00% duty cycle. Pressing the button again will repeat the cycle. Use a value of 50 l-esz for prm and use one of the Timer modules or delay functions to create the time delays. Also, connect a green LED and red LED to the microcontroller. The green LED should illuminate when the motor is rotating in the forward direction and the red LED should illuminate when the motor is rotating in the reverse direction. Do not forget to use a current limiting resistor [4T0 0} for each LEO

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

Physics of Everyday Phenomena A conceptual Introduction to physics

Authors: W. Thomas Griffith, Juliet W. Brosing

6th edition

9780073513904, 73513903, 9781259894008, 1259894002, 978-0073512112

More Books

Students also viewed these Physics questions

Question

2. It is the results achieved that are important.

Answered: 1 week ago