Hi! I am currently working on a project that is a haptic glove for a VR setup. It uses one servo that is connected to each finger that uses data from its potentiometer and inputs it into motion in a game that I build in the Unity Engine. The problem that I am currently having is that I need the servo to pull backwards when the finger is at a certain angle (found from potentiometer). I need to program a loop in which it checks what the servos current angle is at and tests if it is at a certain angle, then it sets the servo to that angle for a split second and then detaches it again in order for the user to not get stuck in that position. That is where the problem comes. I want the servo's default state to be detached or disabled so that the user is able to "push" against it freely while still being able to track the built in potentiometer so that it knows when to reattach the servo and set its position. I do not know how to go about this and code this so if anyone is able to help I would really appreciate it. Thanks!
Those are a lot of things that you want but do you WANT to pay?
arduino_new:
Those are a lot of things that you want but do you WANT to pay?
No I just need to know if there is a way to find the servo position while still having the servo disabled.
the servo does not have the capability to "know" its position, you will have to keep track of it yourself
arduino_new:
the servo does not have the capability to "know" its position, you will have to keep track of it yourself
No I mean the built in potentiometer (used by the servo.read function.)
That's not what servo.read() does. It just returns the last positional command that you sent to the servo. It doesn't tell you if the servo is actually in that position.
For the information you seem to want you would need a servo providing feedback from it's internal potentiometer. They exist but are rare outside expensive industrial servos. Adafruit do a few e.g. these.
Steve