For testing and learning the 16F628A is seems to be OK. But now I try to convert the pulse reading to distance. One full encoder turn generates 1440 pulses. The wheel diameter is 25mm, the circumference is 157mm. I want reading precision to 0,1mm. I try basic math like:
Code:
Main_Loop:
if Flag = 1 then
let counter = (enc_counter/36) * 157 / 4
Lcdout $fe, 1
lcdout Dec counter ; display counter value on LCD
Flag = 0
endif
goto Main_Loop
But the precision is terrible, can you explain me the right way?
Bookmarks