Hi,
Although I do not use PROTON it seems that this is a "PROTON" code and will not compile in PBP.
May be something of this sort may work.
Code:
DEFINE OSC 4
DEFINE ADC_BITS 8 'Number of bits in ADCIN result
DEFINE ADC_CLOCK 3 'ADC clock source (rc = 3)
DEFINE ADC_SAMPLEUS 50 'ADC sampling time in microseconds
DEFINE LCD_DREG PORTB ' Set LCD Data port
DEFINE LCD_DBIT 4 ' Set starting Data bit (0 or 4) if 4-bit bus i.e, Portb.4-PORTb.7
DEFINE LCD_RSREG PORTB ' Set LCD Register Select port
DEFINE LCD_RSBIT 2 ' Set LCD Register Select bit i.e, PORTC.5
DEFINE LCD_EREG PORTB ' Set LCD Enable port
DEFINE LCD_EBIT 3 ' Set LCD Enable bit i.e, PORTB.3
DEFINE LCD_BITS 4 ' Set LCD bus size ot 4 bit Upper Nibble (4 or 8 bits)
DEFINE LCD_LINES 2 ' Set number of lines on LCD to 4 Lines
DEFINE LCD_COMMANDUS 2000 ' Set command delay time in us
DEFINE LCD_DATAUS 50 ' Set data delay time in us
VOLT VAR BYTE ' VOLT AS A VARIABLE
TRISA.0 = 1 ' SETUP PORTA.1 AS AN INPUT
TRISB = 0 '
Input PORTA.0
ADCON1 = %10000000
LCDOUT $FE,1 : PAUSE 100
main:
ADCIN 0, VOLT
LCDOUT $FE,$80, DEC VOLT , " "
goto main
It compiles okay and "hex attached"
Bookmarks