be80be
Well-Known Member
I did this last night the first for loop works the second one doesn't.
I can't for the life of me figure it out.
I can't for the life of me figure it out.
Code:
PWM1_Initialize();
while (1)
{
uint16_t load;
uint16_t dutycycle;
for (load = 0; load < 0x03FF; load++)
{
__delay_ms (500);
dutycycle = load;
PWM1_LoadDutyValue(dutycycle);
}
for (load = 0x03FF; load > 0x03FF; load--)
{
dutycycle = load;
PWM1_LoadDutyValue(dutycycle);
}
}
Last edited: