Device 16F876 ' Define what device your using
XTAL = 4 ' Set the Osc speed
All_Digital = True ' Make all outputs digital (turn of anolouge features)
Dim Pin as Byte ' Create a registry that can hold a value between 0 to 255
TRISB = %00000000 ' Make every Pin of port B an output (theres 8 pins on port B
' the % modifer means I'm working in binary for the following number)
PORTB = %00000000 ' Set all the Pins to Low ( 0V)
Main: ' A label
Repeat
Toggle PORTB.Pin
Delayms 1000
Inc Pin
Until Pin = 8
Repeat
Toggle PORTB.Pin
Delayms 1000
Dec Pin
Until Pin = 255 ' Pin will decrement to 0, then roll over to 255
Goto Main ' Do this for ever