Datasheet

Delay_ms(40); // Small delay to avoid
deboucing effect
Inc(current_duty); // Increment duty ratio
PWM16bit_Set_Duty(current_duty); // Set incremented duty
end
else
if (PINC.B1 <> 0) then // Detect if PORTC pin 1 is pressed
begin
Delay_ms(40); // Small delay to avoid
deboucing effect
Dec(current_duty); // Decrement duty ratio
PWM16bit_Set_Duty(current_duty); // Set decremented
duty ratio
end
else
if (PINC.B2 <> 0) then // Detect if PORTC pin 2 is pressed
begin
Delay_ms(40); // Small delay
to avoid deboucing effect
Inc(current_duty1); // Increment duty ratio
PWM16bit_Set_Duty(current_duty1); // Set incre-
mented duty
end
else
if (PINC.B3 <> 0) then// Detect if PORTC pin 3 is pressed
begin
Delay_ms(40);// Small delay to avoid deboucing effect
Dec(current_duty1); // Decrement duty ratio
PWM16bit_Set_Duty(current_duty1); // Set decre-
mented duty ratio
end;
end;
end.
336
MIKROELEKTRONIKA - SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Libraries
mikroPASCAL PRO for AVR
CHAPTER 6