A BASIC LED CHASER USING PIC16F877A
PROGRAM
#Chip 16f877a, 16
dir portc.0 out
dir portc.1 out
dir portc.2 out
dir portc.3 out
dir portd.0 out
dir portd.1 out
dir portc.2 out
dir portc.3 out
wait 1 s
do
'chase.........................................
set portc.0 on
wait 175 ms
set portc.0 off
set portc.1 on
wait 175 ms
set portc.1 off
set portc.2 on
wait 175 ms
set portc.2 off
set portc.3 on
wait 175 ms
set portc.3 off
set portd.0 on
wait 175 ms
set portd.0 off
set portd.1 on
wait 175 ms
set portd.1 off
set portd.2 on
wait 175 ms
set portd.2 off
set portd.3 on
wait 175 ms
set portd.3 off
set portc.0 on
wait 175 ms
set portc.0 off
set portc.1 on
wait 175 ms
set portc.1 off
set portc.2 on
wait 175 ms
set portc.2 off
set portc.3 on
wait 175 ms
set portc.3 off
set portd.0 on
wait 175 ms
set portd.0 off
set portd.1 on
wait 175 ms
set portd.1 off
set portd.2 on
wait 175 ms
set portd.2 off
set portd.3 on
wait 175 ms
set portd.3 off
set portc.0 on
wait 175 ms
set portc.0 off
set portc.1 on
wait 175 ms
set portc.1 off
set portc.2 on
wait 175 ms
set portc.2 off
set portc.3 on
wait 175 ms
set portc.3 off
set portd.0 on
wait 175 ms
set portd.0 off
set portd.1 on
wait 175 ms
set portd.1 off
set portd.2 on
wait 175 ms
set portd.2 off
set portd.3 on
wait 175 ms
set portd.3 off
set portc.0 on
wait 175 ms
set portc.0 off
set portc.1 on
wait 175 ms
set portc.1 off
set portc.2 on
wait 175 ms
set portc.2 off
set portc.3 on
wait 175 ms
set portc.3 off
set portd.0 on
wait 175 ms
set portd.0 off
set portd.1 on
wait 175 ms
set portd.1 off
set portd.2 on
wait 175 ms
set portd.2 off
set portd.3 on
wait 175 ms
set portd.3 off
' chase fwd rev.........................................................
set portc.0 on
wait 175 ms
set portc.0 off
set portc.1 on
wait 175 ms
set portc.1 off
set portc.2 on
wait 175 ms
set portc.2 off
set portc.3 on
wait 175 ms
set portc.3 off
set portd.0 on
wait 175 ms
set portd.0 off
set portd.1 on
wait 175 ms
set portd.1 off
set portd.2 on
wait 175 ms
set portd.2 off
set portd.3 on
wait 175 ms
set portd.3 off
wait 175 ms
set portd.3 on
wait 175 ms
set portd.3 off
set portd.2 on
wait 175 ms
set portd.2 off
set portd.1 on
wait 175 ms
set portd.1 off
set portd.0 on
wait 175 ms
set portd.0 off
set portc.3 on
wait 175 ms
set portc.3 off
set portc.2 on
wait 175 ms
set portc.2 off
set portc.1 on
wait 175 ms
set portc.1 off
set portc.0 on
wait 175 ms
set portc.0 off
'repeat
set portc.0 on
wait 175 ms
set portc.0 off
set portc.1 on
wait 175 ms
set portc.1 off
set portc.2 on
wait 175 ms
set portc.2 off
set portc.3 on
wait 175 ms
set portc.3 off
set portd.0 on
wait 175 ms
set portd.0 off
set portd.1 on
wait 175 ms
set portd.1 off
set portd.2 on
wait 175 ms
set portd.2 off
set portd.3 on
wait 175 ms
set portd.3 off
wait 175 ms
set portd.3 on
wait 175 ms
set portd.3 off
set portd.2 on
wait 175 ms
set portd.2 off
set portd.1 on
wait 175 ms
set portd.1 off
set portd.0 on
wait 175 ms
set portd.0 off
set portc.3 on
wait 175 ms
set portc.3 off
set portc.2 on
wait 175 ms
set portc.2 off
set portc.1 on
wait 175 ms
set portc.1 off
set portc.0 on
wait 175 ms
set portc.0 off
set portc.0 on
wait 175 ms
set portc.0 off
set portc.1 on
wait 175 ms
set portc.1 off
set portc.2 on
wait 175 ms
set portc.2 off
set portc.3 on
wait 175 ms
set portc.3 off
set portd.0 on
wait 175 ms
set portd.0 off
set portd.1 on
wait 175 ms
set portd.1 off
set portd.2 on
wait 175 ms
set portd.2 off
set portd.3 on
wait 175 ms
set portd.3 off
wait 175 ms
set portd.3 on
wait 175 ms
set portd.3 off
set portd.2 on
wait 175 ms
set portd.2 off
set portd.1 on
wait 175 ms
set portd.1 off
set portd.0 on
wait 175 ms
set portd.0 off
set portc.3 on
wait 175 ms
set portc.3 off
set portc.2 on
wait 175 ms
set portc.2 off
set portc.1 on
wait 175 ms
set portc.1 off
set portc.0 on
wait 175 ms
set portc.0 off
set portc.0 on
wait 175 ms
set portc.0 off
set portc.1 on
wait 175 ms
set portc.1 off
set portc.2 on
wait 175 ms
set portc.2 off
set portc.3 on
wait 175 ms
set portc.3 off
set portd.0 on
wait 175 ms
set portd.0 off
set portd.1 on
wait 175 ms
set portd.1 off
set portd.2 on
wait 175 ms
set portd.2 off
set portd.3 on
wait 175 ms
set portd.3 off
wait 175 ms
set portd.3 on
wait 175 ms
set portd.3 off
set portd.2 on
wait 175 ms
set portd.2 off
set portd.1 on
wait 175 ms
set portd.1 off
set portd.0 on
wait 175 ms
set portd.0 off
set portc.3 on
wait 175 ms
set portc.3 off
set portc.2 on
wait 175 ms
set portc.2 off
set portc.1 on
wait 175 ms
set portc.1 off
set portc.0 on
wait 175 ms
set portc.0 off
set portc.0 on
wait 175 ms
set portc.0 off
set portc.1 on
wait 175 ms
set portc.1 off
set portc.2 on
wait 175 ms
set portc.2 off
set portc.3 on
wait 175 ms
set portc.3 off
set portd.0 on
wait 175 ms
set portd.0 off
set portd.1 on
wait 175 ms
set portd.1 off
set portd.2 on
wait 175 ms
set portd.2 off
set portd.3 on
wait 175 ms
set portd.3 off
wait 175 ms
set portd.3 on
wait 175 ms
set portd.3 off
set portd.2 on
wait 175 ms
set portd.2 off
set portd.1 on
wait 175 ms
set portd.1 off
set portd.0 on
wait 175 ms
set portd.0 off
set portc.3 on
wait 175 ms
set portc.3 off
set portc.2 on
wait 175 ms
set portc.2 off
set portc.1 on
wait 175 ms
set portc.1 off
set portc.0 on
wait 175 ms
set portc.0 off
wait 150 ms
'new
set portc.0 on
wait 100 ms
set portc.0 off
set portc.1 on
wait 100 ms
set portc.1 off
set portc.2 on
wait 100 ms
set portc.2 off
set portc.3 on
wait 100 ms
set portc.3 off
set portd.0 on
wait 100 ms
set portd.0 off
set portd.1 on
wait 100 ms
set portd.1 off
set portd.2 on
wait 100 ms
set portd.2 off
set portd.3 on
wait 100 ms
set portd.3 off
wait 100 ms
set portd.3 on
'repeat.........................
set portc.0 on
wait 100 ms
set portc.0 off
set portc.1 on
wait 100 ms
set portc.1 off
set portc.2 on
wait 100 ms
set portc.2 off
set portc.3 on
wait 100 ms
set portc.3 off
set portd.0 on
wait 100 ms
set portd.0 off
set portd.1 on
wait 100 ms
set portd.1 off
set portd.2 on
set portd.3 on
set portc.0 on
wait 100 ms
set portc.0 off
set portc.1 on
wait 100 ms
set portc.1 off
set portc.2 on
wait 100 ms
set portc.2 off
set portc.3 on
wait 100 ms
set portc.3 off
set portd.0 on
wait 100 ms
set portd.0 off
set portd.1 on
set portc.0 on
wait 100 ms
set portc.0 off
set portc.1 on
wait 100 ms
set portc.1 off
set portc.2 on
wait 100 ms
set portc.2 off
set portc.3 on
wait 100 ms
set portc.3 off
set portd.0 on
set portc.0 on
wait 100 ms
set portc.0 off
set portc.1 on
wait 100 ms
set portc.1 off
set portc.2 on
wait 100 ms
set portc.2 off
set portc.3 on
set portc.0 on
wait 100 ms
set portc.0 off
set portc.1 on
wait 100 ms
set portc.1 off
set portc.2 on
set portc.0 on
wait 100 ms
set portc.0 off
set portc.1 on
set portc.0 on
'program together on down
set portc.0 on
wait 100 ms
set portc.0 off
set portc.1 on
wait 100 ms
set portc.1 off
set portc.2 on
wait 100 ms
set portc.2 off
set portc.3 on
wait 100 ms
set portc.3 off
set portd.0 on
wait 100 ms
set portd.0 off
set portd.1 on
wait 100 ms
set portd.1 off
set portd.2 on
wait 100 ms
set portd.2 off
set portd.3 on
wait 100 ms
set portd.3 off
wait 100 ms
set portd.3 on
'repeat.........................
set portc.0 on
wait 100 ms
set portc.0 off
set portc.1 on
wait 100 ms
set portc.1 off
set portc.2 on
wait 100 ms
set portc.2 off
set portc.3 on
wait 100 ms
set portc.3 off
set portd.0 on
wait 100 ms
set portd.0 off
set portd.1 on
wait 100 ms
set portd.1 off
set portd.2 on
set portd.3 on
set portc.0 on
wait 100 ms
set portc.0 off
set portc.1 on
wait 100 ms
set portc.1 off
set portc.2 on
wait 100 ms
set portc.2 off
set portc.3 on
wait 100 ms
set portc.3 off
set portd.0 on
wait 100 ms
set portd.0 off
set portd.1 on
set portc.0 on
wait 100 ms
set portc.0 off
set portc.1 on
wait 100 ms
set portc.1 off
set portc.2 on
wait 100 ms
set portc.2 off
set portc.3 on
wait 100 ms
set portc.3 off
set portd.0 on
set portc.0 on
wait 100 ms
set portc.0 off
set portc.1 on
wait 100 ms
set portc.1 off
set portc.2 on
wait 100 ms
set portc.2 off
set portc.3 on
set portc.0 on
wait 100 ms
set portc.0 off
set portc.1 on
wait 100 ms
set portc.1 off
set portc.2 on
set portc.0 on
wait 100 ms
set portc.0 off
set portc.1 on
set portc.0 on
set portc.0 on
wait 100 ms
set portc.0 off
set portc.1 on
wait 100 ms
set portc.1 off
set portc.2 on
wait 100 ms
set portc.2 off
set portc.3 on
wait 100 ms
set portc.3 off
set portd.0 on
wait 100 ms
set portd.0 off
set portd.1 on
wait 100 ms
set portd.1 off
set portd.2 on
wait 100 ms
set portd.2 off
set portd.3 on
wait 100 ms
set portd.3 off
wait 100 ms
set portd.3 on
'repeat.........................
set portc.0 on
wait 100 ms
set portc.0 off
set portc.1 on
wait 100 ms
set portc.1 off
set portc.2 on
wait 100 ms
set portc.2 off
set portc.3 on
wait 100 ms
set portc.3 off
set portd.0 on
wait 100 ms
set portd.0 off
set portd.1 on
wait 100 ms
set portd.1 off
set portd.2 on
set portd.3 on
set portc.0 on
wait 100 ms
set portc.0 off
set portc.1 on
wait 100 ms
set portc.1 off
set portc.2 on
wait 100 ms
set portc.2 off
set portc.3 on
wait 100 ms
set portc.3 off
set portd.0 on
wait 100 ms
set portd.0 off
set portd.1 on
set portc.0 on
wait 100 ms
set portc.0 off
set portc.1 on
wait 100 ms
set portc.1 off
set portc.2 on
wait 100 ms
set portc.2 off
set portc.3 on
wait 100 ms
set portc.3 off
set portd.0 on
set portc.0 on
wait 100 ms
set portc.0 off
set portc.1 on
wait 100 ms
set portc.1 off
set portc.2 on
wait 100 ms
set portc.2 off
set portc.3 on
set portc.0 on
wait 100 ms
set portc.0 off
set portc.1 on
wait 100 ms
set portc.1 off
set portc.2 on
set portc.0 on
wait 100 ms
set portc.0 off
set portc.1 on
set portc.0 on
loop
1 Comments
How to write code pixel led
ReplyDelete