Device = 18F1320
Clock = 4 // 4MHz clock
Config OSC = INTIO2, WDT = OFF, LVP = OFF
Include "JuneBug.bas"
Dim Lit As Byte
Dim Keys As Byte
OSCCON = $62 // select 4MHz internal clock
ADCON1 = $7f //all digital
Lit=1
While true
DelayMS(10) //for debounce
Keys=ReadKeys() //read the push buttons
If (Keys=1) Then //if button 1 pressed
Lit=Lit+1 //light LED to right
If Lit=7 Then //gone to far
Lit=1 //yes, so wrap around
EndIf
ElseIf (Keys=2) Then
Lit=Lit-1 //scroll em left
If Lit=0 Then
Lit=6
EndIf
EndIf
LED(Lit) //light the LED
Wend
End