We have a robot built using an arm with a gear drive, with a potentiometer on the top shaft. What I need to do is write/get some code which will allow me to basically use it like a giant servo. The way the logic works in my head is this: (translate this into C somehow? I’m new to programming)
Read stick position.
Determine arm position.
read difference between the two
move motor to make stick and arm position equal
if arm moves and stick doesn’t, fight back and correct
And have a limited range of movement, so top of stick= max range of travel for the arm. I could do this with a limit switch but it likes to bounce on and off of the switch.
Hopefully someone can figure out what I’m trying to do and help us. THe comp is on saturday and we need to figure this out. I just have zero programming experience aside from setting it up as essentially an RC vehicle and doing time based autonomous.