Calibrate formula for PING
Considering about environment affecting Ping sensor, can someone provide me a formula code for calibrating Ping?
The purpose of this is I can adjust the Ping to suit the environment.
At this moment, my formula is DISTANCE = (2260 ** TIME).
If I can calibrate, I can re-calculate the constant value (2260) according to environment.
The problem is I don't really understand how to invert ** operation.
Regards,
Bronson Alex
The purpose of this is I can adjust the Ping to suit the environment.
At this moment, my formula is DISTANCE = (2260 ** TIME).
If I can calibrate, I can re-calculate the constant value (2260) according to environment.
The problem is I don't really understand how to invert ** operation.
Regards,
Bronson Alex
Comments
in DISTANCE = factor ** TIME.
'---------binary division loop----------- [COLOR=#ff0000]' Enter with distance < time, distance<32768, time<32768 FOR idx=15 TO 0 ' 16 bits distance = distance // time << 1 ' remainder*2 F.Bit0(idx) = distance/time ' next bit NEXT RETURN ' F is the factor for **[/COLOR]
There is an explanation at this URL.