;-------------------------- asteapta puls de 1ms
Speed equ .04
movlw 0 ;start at zero
uu movwf CCPR1L ;put W into CCP
call pause
movlw Speed ;put speed in W
addwf CCPR1L,w ;and add it to CCP value - result in W
btfss STATUS,Z ;if W=0 then skip next line
goto uu ;go back and do it again
movlw .256-Speed ;0x100-speed = full brightness
Dw movwf CCPR1L ;into CCP
call Pause
movlw Speed ;put Speed in W
addwf CCPR1L,w ;and add it to CCP value - result in W
btfss STATUS,Z ;if W=0 then skip next line
goto Dw ;loop until LED is out
goto uu ;Start all over again
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
set_timer