ok i get the idea for the average of my rate,
but now how can i do if i don t have a clue how fast i move (not a constant acceleration)
there is tyle an unknow parameter
for the moment i m trying that:
main:
ReadAD:
ADCON0.2 = 1 ' Start conversion
AD0H = ADRESH
AD0L = ADRESL
AD0=(AD0H*4)+(AD0L/64)
pause 1000
ADCON0.2 = 1 ' Start conversion
AD1H = ADRESH
AD1L = ADRESL
AD1=(AD1H*4)+(AD1L/64)
SEROUT2 PORTA.2,32,[$A3,$01] 'clear alcd and locate in 0,0
SEROUT2 PORTA.2,32,["ado:",dec ad0]
SEROUT2 PORTA.2,32,[$A1,0,1]
sEROUT2 PORTA.2,32,["ad1:",dec ad1]
if ad0 > ad1 then
pan= ad0-ad1
SEROUT2 PORTA.2,32,[$A1,0,3]
sEROUT2 PORTA.2,32,["pan: +",dec pan ]
endif
if ad1 > ad0 then
pan= ad1-ad0
SEROUT2 PORTA.2,32,[$A1,0,3]
sEROUT2 PORTA.2,32,["pan: -",dec pan ]
endif
goto main
i can get a result but the variation of pan is very low from -60 to 60 if i move the sensor very fast
if think i should use +vref and - vref cause it ll be more accurate
i don 't know
i just HATE math
Bookmarks