Hi tcrenshaw4bama! I’m copying your second question over to the general forum so all users (including me :)) can answer it.
I think this bit of pseudo-code might solve your problem.
It uses a integer variable (servoPos) to store the current setting of the servo. The result is that pressing the “U” button makes the servo turn backward 63 more “ticks,” and that pressing the “D” button makes the servo turn forward 63 more “ticks.”
int servoPos = 0; //Initiates servo position variable (stores current position here)
while(true) //Loop for driver control
{
if((U button pressed on Ch7) && (servoPos >= -126)) //Do this if the U button is pressed, and servoPos isn't at lowest setting
{
servoPos = servoPos - 63; //Decrease servoPos variable by 63
setMotor[your servo] = servoPos; //Sets the actual servo's position to the value of servoPos
}
if(D button pressed on Ch7 && (servoPos <= 126) //Do this if the D button is pressed and servoPos isn't at highest setting
{
servoPos = servoPos + 63; //Increase servoPos variable by 63
setMotor[your servo] = servoPos; //Sets the actual servo's position to the value of servoPos
}
}
Hope this helps!