So I was thinking, and I know I could just test this but I don’t want to waste that much time programming this just for it not to work. Could you use potentiometers to hold a chain-bar at the correct height to get pre-loads. I think it would work something like this:
while(Btn6U = true) //while button is pressed
{
if(SensorValue[potentiometer] > 150) // if arm is farther than a little less than straight up
{
motor[armmotors] = -127; // then arm goes down
}
else if(SensorValue[potentiometer] < 90) // if arm is less than straight out
{
motor[armmotors] = 63; // then the arm goes up with lower power
}
else if(SensorValue[potentiometer] < 40) // if arm is lowered all the way, or almost all the way
{
motor[armmotors] = 127; // then the arm goes up with full power
}
else // if none of the above are true
{
motor[armmotors] = 30; //then the arm uses a little power to counteract gravity and stay in place
}
}
assuming the values are correct, could this work.