Question: If Pressed RA 1 button, what will happen? void main 0 1 unsiened short current _ duty, ald _ duty, current _ duty 1 ,
If Pressed RA button, what will happen?
void main
unsiened short currentduty, aldduty, currentduty oldduty:
PORTA ;
TRISA ;
PORTB ;
TRISB ;
PORTC ;
TRISC ;
PWMInaSO:
PWMinit:
currentduly ;
currentduty;
PWMstari:
PWMstart:
PWMSetOutycurrentduty; Set current duty for PWM
PWMSetOutycurrentduty: Set curtent duty for PWM
while endless loop
if RAObit button on Rropressed
Delayms:
currentduty; increment currentduty
PWMSetOutycurrentduty:
If RAbit button on RA pressed
Delayms :
currentduty decrement currentduty
PWMSetDutycurientduty:
I
configure PORTA pins as input
set PORTO
devignate PORTB plins as output
set POATC
devienate PORTC plins as output
I initialize PWMI module at
Initialize PWM module at KHiz
Inlidal value for currentduty
I initial value for curtentduty
start PWM
Istar PWMa
increment currentduty
Ibution on RaI pressed
decrement currentduty
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
