Device = 18F452
Clock = 10
// alias to port pin...
Dim led_1 As PORTA.0,
led_2 As PORTA.1,
led_3 As PORTA.2,
led_4 As PORTA.3,
led_5 As PORTA.4,
led_6 As PORTA.5,
ledx(6) As Byte
Dim pt As Word
ledx(0)=0
ledx(1)=0
ledx(2)=0
ledx(3)=0
ledx(4)=0
ledx(5)=0
pt=0
While (true) // left to right leds
ledx(pt)=1 // ledx0 is on
DelayMS(1000)
ledx(pt) = 0
pt=pt +1
Repeat Until pt >5
Wend
While (true) //right to left leds
ledx(pt)=1
DelayMS(1000)
ledx(pt) = 0
pt=pt -1
Repeat Until pt <0
Wend