Skip to main content
6 events
when toggle format what by license comment
Mar 15, 2023 at 16:56 comment added Coder Yes, I did a bit more research and reached the same conclusion as you. I am moving towards a new circuit that includes a few extra devices like a potentiometer or a rotary encoder. Thanks again !!
Mar 14, 2023 at 17:30 comment added joan You can not get the position of a sg-90 servo from the servo itself. It will be the same answer for all 3-pin servos (ground, power, control). Remember a servo moves to an absolute angle. So 0 will always set the centre. It does not move to an angle relative to the current position.
Mar 14, 2023 at 16:38 comment added Coder I appreciate you indulging in our conversation, by manually I meant I rotation the servo to different angles using another program I wrote, I didn't physically rotate the servo. The servo I am using is an sg-90, you think it has the feature ? I tried the same code with additional code that presets servo value as per user input and then checks the servo's angle. It would set it to the entered angle but it would still return 0.0 and turn the servo to 90 degree . Is it because the sg-90 does not have the required features ?
Mar 14, 2023 at 16:13 comment added joan Do you mean you manually rotated the servo before running the code? Be careful you can damage the gears. As the code does not set an angle the gpiozero default of 0 will be sent to the servo. This will always be the servos central position. Some expensive servos include encoders which can return the current position. It is a very rare feature.
Mar 14, 2023 at 15:59 comment added Coder Appreciate the response, thank you for that, but I did set the servo to different angles before i ran this code, the output was still 0.0 and the servo still moved to a 90 degree position. Is there a way to receive the desired output ? i.e an accurate reading of the servo motors angle.
Mar 14, 2023 at 13:14 history answered joan CC BY-SA 4.0