Tutorial 1 help please
Posted: Tue Aug 03, 2010 7:36 am
Hey everyone, i just started programming about a week ago so don't be surprised if i'm doing something completely wrong.
I'm trying to make a led stay on longer than its stays off and this is my approach.
Please tell me if my approach would work.
Thanks
Anthony
I'm trying to make a led stay on longer than its stays off and this is my approach.
Please tell me if my approach would work.
Thanks
Anthony
Code: Select all
begin
bsf PORTB, 0
call ledon
bcf PORTB, 0
call ledoff
goto begin
ledon
movlw d'255'
movwf delay_1
movwf delay_2
movlw d'255'
movwf delay_3
delay_loopon
decfsz delay_1, f
goto delay_loopon
decfsz delay_2, f
goto delay_loopon
decfsz delay_3, f
goto delay_loopon
return
ledoff
movlw d'255'
movwf delay_4
movwf delay_5
delay_loopoff
decfsz delay_4, f
goto delay_loopoff
decfsz delay_5, f
goto delay_loopoff
return
end