hello all,
Am trying to get my head around the use of comparators. I had the idea of using two LDR (in a voltage divider setup as in manual 3) placing the signal wire of the ldr to b.2 which is comparator 2+
One on either side of of my bot a basic line detection. Having trouble in the simulator with the compset with the sim. saying "Interenal voltage reference for compsetup is not currently simulated". Am experimenting with 20x2 for now altough the code i written passes the syntax check i hav'nt programmed the picaxe for fear of damaging the pin. am sure this is the first of many error's
please point me in the right direction guys
thanks jinx
Am trying to get my head around the use of comparators. I had the idea of using two LDR (in a voltage divider setup as in manual 3) placing the signal wire of the ldr to b.2 which is comparator 2+
One on either side of of my bot a basic line detection. Having trouble in the simulator with the compset with the sim. saying "Interenal voltage reference for compsetup is not currently simulated". Am experimenting with 20x2 for now altough the code i written passes the syntax check i hav'nt programmed the picaxe for fear of damaging the pin. am sure this is the first of many error's
Code:
#picaxe 20x2
let adcsetup = %0000000000001000 ; set ADC4
compsetup %01101010,0 ; use comparators 2
setintflags %00010000,%00010000
symbol lsens = b.2 'comp2+
symbol led = b.7
symbol adcval = b1
main:
do
readadc lsens,adcval
SerTxd( #adcval, CR, LF )
low led
pause 10
loop
interrupt:
setintflags off
compsetup 0,0
pause 10
sertxd ("warning left",cr,lf)
gosub flash
pause 10
compsetup %0101010,0
compflag = 0
setintflags %00010000,%00010000
pause 200
return
flash:
high led
pause 200
return
thanks jinx