Hi All, tried this code, its working but is there any other reliable way....
adval var byte ' Create adval to store result
TRISA = %11111111 ' Set PORTA to all input
ADCON1 = %00000010 ' Set PORTA analog
Pause 500 ' Wait .5 second
loop: ADCIN 0, adval ' Read channel 0 to adval
Lcdout $fe, 1 ' Clear LCD
Lcdout "Value: ", DEC adval ' Display the decimal value
Select case adval
CASE is <51
high porte.0
cASE 102
high porte.1
CASE 153
high portd.2
CASE 204
high portd.3
CASE is >225
low porte.0 : low porte.1 : low portd.2 : low portd.3
Pause 150
END SELECT
pause 100
Goto loop
End
* this below line is not accepting :ERROR
case >1 to <53
'do some thing
case >53 to < 102
'do some thing..
So On.....




Bookmarks