Okay I am not sure how to program the servo, I have a servo plugged into the digital sidecar on PWM #3, and I am not sure how to program it moving so this is the code that we have, so could you tell us our problem?
I think your major problem is that you haven’t read any of the documentation on C++ coding: http://first.wpi.edu/Images/CMS/First/FRC1718Docs.zip There’s a nice packet of information there. Here’s how to fix your program:
You’re getting your functions confused.
servo.Set() accepts a range from -1 to 1 for min to max values of the servo - this is here so you can just directly accept another float value from something else (like a joystick) and just set it directly.
servo.SetAngle() accepts an angle that you wish to set your servo at. Try using this with your 170 angle and see if that works.
Oh, right. Most of the other functions are -1 to 1, didn’t look at the docs.
If you need to scale (-1, 1) to (0, 1) you can use
prevVal = joystick(1)->Get(); //-1 to 1 value
ScaledVal = (prevVal + 1)/2; //Scaled to 0 to 1