|
I might be misunderstanding the issue, but it seems you are trying to make a servo, i.e. the motor turns until the feedback pot and the control pot give the same value.
[edit]Your code seems to be unnecessarily complex, [/edit]
...wouldn't
if feedback_pot < control_pot then [turn motor one way]
if feedback_pot > control_pot then [turn motor other way]
work for this?
[edit]
You could tweak the if...then statements a bit to allow slight error:
if feedback_pot+255 < control_pot +245 then [one way]
if feedback_pot+255 > control_pot +265 then [other way]
[/edit]
__________________
Adler Attack #933 -- Trigos
Last edited by n[ate]vw : 01-02-2003 at 18:59.
|