I am having problems in iterfacing with a LDR and a potentiometer with 20X2 chip.
I am connecting a LDR to pin c.7 and a potentiometer to b.1
I want to build a logic to compare values of LDR and potentiometer and when LDR > pot I want to trigger a action.
I read that X2 chips require adcsetup before reading the values.
I write the program as below.
adcsetup=%0000000000001010
main: readadc c.7,b0
debug b0
goto main
In the debug panel I see that the value of b0 changes continuously from 184 to 213. At the moment I have connected a pot insted of a LDR.
I can not figure out what is going wrong.
Thanks.
I am connecting a LDR to pin c.7 and a potentiometer to b.1
I want to build a logic to compare values of LDR and potentiometer and when LDR > pot I want to trigger a action.
I read that X2 chips require adcsetup before reading the values.
I write the program as below.
adcsetup=%0000000000001010
main: readadc c.7,b0
debug b0
goto main
In the debug panel I see that the value of b0 changes continuously from 184 to 213. At the moment I have connected a pot insted of a LDR.
I can not figure out what is going wrong.
Thanks.