///////////////////////////////////////////////////////////////////////////////
Device = 18F1320 // Set to your chip
Clock = 8 // 8MHz clock
Config OSC = INTIO2, WDT = OFF, LVP = OFF, MCLRE = OFF
#option LCD_DATA = PORTB.4 // you can use any 18F chip
#option LCD_RS = PORTB.3 // just set whats in here to match your chip
#option LCD_EN = PORTB.2
////////////////////////////////////////////////////////////////////////////////
Include "IntOSC.bas"
Include "LCD.bas"
Include "Utils"
Include "convert.bas"
Const port_scan (9) As Byte = (0, 1, 2, 3, 4, 5, 6, 7, 8) //Constant arrays
Dim Index As Byte //holds value of the constant
ADCON1 = $07 // PORTB as digital (LCD)
While true
Cls // clears the lcd
For Index = 0 To Bound(port_scan) //Sends out the constant values
LCD.MoveCursor (1,1)
LCD.Write ("Counter = ",DecToStr(Index) ) //shows you on the LCD
DelayMS (250) // little delay to see the counter change
Next
Wend