I would change all those jumps and use ADCIN.
<b>
Define LOADER_USED 1
' Define LCD pins
Define LCD_DREG PORTD
Define LCD_DBIT 4
Define LCD_RSREG PORTE
Define LCD_RSBIT 0
Define LCD_EREG PORTE
Define LCD_EBIT 1
' Allocate variables
x var byte
y var byte
z var byte
ADCON1 = 4 ' Set PortA 0, 1, 3 to analog inputs
Low PORTE.2 ' LCD R/W line low (W)
Pause 100 ' Wait for LCD to start
mainloop:
ADCIN 0, x ' Read channel 0 to x
ADCIN 1, y ' Read channel 1 to y
ADCIN 3, z ' Read channel 3 to z
Lcdout $fe, 1, "x=", #x, " y=", #y, " z=", #z ' Send values to LCD
Pause 100
mainloop
</b>
This code will cause the same effect as the example.
Ivancho
Bookmarks