Question: If Pressed RA 1 button, what will happen? void main 0 1 unsiened short current _ duty, ald _ duty, current _ duty 1 ,

If Pressed RA1 button, what will happen?
void main01
unsiened short current_duty, ald_duty, current_duty1, old_duty1:
PORTA =255;
TRISA =255;
PORTB =0;
TRISB =0;
PORTC =0;
TRISC =0;
PWM1_Ina(SO00):
PWM2_init(5000):
current_duly =16;
current_duty1=16;
PWM1_stari0:
PWM2_start1):
PWM1_Set_Outy(current_duty); // Set current duty for PWM1
PWM12_Set_Outy(current_duty1): //Set curtent duty for PWM2
while (1))// endless loop
if (RAO_bit))// button on Rropressed
Delay_ms(40):
current_duty+4; // increment current_duty
PWM1_Set_Outy(current_duty):
If (RA1_bit)(// button on RA1 pressed
Delay_ms (40) :
current_duty ,?? decrement current_duty
PWM1_Set_Duty(curient_duty):
I
// configure PORTA pins as input
// set PORTO 100
// devignate PORTB plins as output
// set POATC 100
// devienate PORTC plins as output
I/ initialize PWMI module at 5KHz
// Initialize PWM2 module at 5KHiz
// Inlidal value for current_duty
I/ initial value for curtent_duty 1
// start PWM1
I/star PWMa
// increment current_duty
I/bution on RaI pressed
//decrement current_duty
 If Pressed RA1 button, what will happen? void main01 unsiened short

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!