The 16F648A does not have a hardware A/D converter, so ReadAD will not work. However, with a couple of extra components you can use the POT command to read a variable resistance - see http://gcbasic.sourceforge.net/help/pot.htm
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm trying to use ReadAD(AN0), but I get an error when compiling, any thoughts?
#chip 16F648A, 20
#config _CP_OFF & _DATA_CP_OFF & _BODEN_OFF & _LVP_OFF & _WDT_OFF & _PWRTE_ON & _HS_OSC
dir PORTA.0 IN
#define LCD_IO 4
#define LCD_DB4 PORTB.0
#define LCD_DB5 PORTB.1
#define LCD_DB6 PORTB.2
#define LCD_DB7 PORTB.3
#define LCD_RS PORTB.5
#define LCD_RW PORTB.6
#define LCD_Enable PORTB.7
Main:
wait 1 sec
Print "HELLO WORLD??"
Locate 1,0
potSensor = ReadAD(AN0)
LCDInt (potSensor)
wait 50 10ms
next add
cls
Goto Main
The 16F648A does not have a hardware A/D converter, so ReadAD will not work. However, with a couple of extra components you can use the POT command to read a variable resistance - see http://gcbasic.sourceforge.net/help/pot.htm