I've since moved on to 18F44K22 after the videos but the code essentially remains the same:
Code:
mainloop:
PortD.2 = 1 ' Heartbeat
TRISA = %11111100
PORTA = %00000001 ' LED 1
PAUSE 200
PORTA = %00000010 ' LED 2
PAUSE 200
TRISA = %11110011
PORTA = %00000100 ' LED 3
PAUSE 200
PORTA = %00001000 ' LED 4
PAUSE 200
PortD.2 = 0 ' Heartbeat
TRISA = %11001111
PORTA = %00010000 ' LED 5
PAUSE 200
PORTA = %00100000 ' LED 6
PAUSE 200
TRISA = %00111111
PORTA = %01000000 ' LED 7
PAUSE 200
PORTA = %10000000 ' LED 8
PAUSE 200
goto mainloop
End
I don't have to set the TRIS register when I remain on the same LED pair.
Bookmarks