Coding Inquire

acdavis1999: While using a light if it if it is below the threshold it will rotate one direction (continuous), but if it is above threshold and it will rotate (further than desired) and hold as long as it remains above threshold.

You have set up two servo position. One is use when above the threshold and the other is used below the threshold. If the servo is moving to the wrong position, change the position you tell it to go to. For hobby servos the typical range is 1000 to 2000 microseconds. If that makes it go about eight turns and you only want it to go one turn, try using the middle 1/8th of the range: values between about 1438 and 1562.

Do you by chance know what I would use as the zero position?

There is no such thing as a "zero position" for a servo. The centre of its movement, if that's what you mean, is normally at about writeMicroseconds(1500). From there an HS785 can be made to go to positions about 4 turns clockwise or 4 turns counterclockwise.

Steve

Thank you! I believe Johnwasser’s suggestion may have done the trick, but I’m going to test it a bit more to be sure.

acdavis1999: Do you by chance know what I would use as the zero position?

Whatever number puts the arm where you want it. Or you could pick a convenient number. Take off the arm, move the servo to the 'zero' of your choice, and put the arm back on in the 'zero' position.

Awesome thank you!