Answered step by step
Verified Expert Solution
Question
1 Approved Answer
2 0 : 0 0 6 Ocak Cmt Back f Pressed RA 2 button, what will happen? void main ( ) ! unsigned shori current
: Ocak Cmt
Back
f Pressed RA button, what will happen?
void main
unsigned shori currentduty, oldduty, currentduty oldduty;
PORTA ;
TRISA ; configure PORTA pins as input
PORTB ; set PORTB to
TRISB ; designate PORTB pins as output
PORTC ; set PORTC to
TRISC ; designate PORTC pins as output
PWMInit; Initialize PWM module at
PWMInit; Initialize PWM module at KHz
currentduty ; initial value for currentduty
currentduty; initial value for currentduty
PWMStart; start PWM
PWMStart; start PWM
PWMSetDutycurrentduty; Set current duty for PWM
PWMSetDutycurrentduty; Set current duty for PWM
while endless loop
if RAObit button on RAO pressed
Delayms;
currentduty; increment currentduty
PWMSetDutycurrentduty;
l
if RAbit button on RA pressed
Delayms; decrement current duty
PWMSetDutycurrentduty:
l
if RAbit button on RA pressed
Delayms;
currentdutyt; increment currentduty
PWMSetDutycurrentduty;
if RAbit button on RA pressed
Delayms:
currentduty ; decrement currentduty
Home
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started