Mikroelektronika MIKROE-350 Fiche De Données
if (PINC1_bit <> 0) then
' Detect if PORTC pin 1 is pressed
Delay_ms(40) ' Small delay to avoid deboucing effect
Dec(current_duty1) ' Decrement duty ratio
PWM1_Set_Duty(current_duty1) ' Set decremented duty ratio
PWM1_Set_Duty(current_duty1) ' Set decremented duty ratio
end if
wend
end.
HW Connection
PWM demonstration
316
MIKROELEKTRONIKA
- SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Libraries
mikroBasic PRO for AVR
CHAPTER 6