Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4906

Python • Re: Can’t control servo motor with Raspberry Pi 5

$
0
0
I’ve just recently bought my first Raspberry Pi and opted for a Pi 5 as it was the latest.

I’ve had no luck getting gpiozero or gpiod working with Python and my MG996R servos yet.

I don’t mind if it’s not the ‘best’ possible servo control as I’m just experimenting with servos for the first time.

However I can’t find any example python code that actually allows me to control a Servo.

All examples for previous raspberry pi versions do not work on the Pi 5

Is something ‘official’ coming out soon or can someone point me at some sample python code that works with Raspberry Pi 5.

I want to start playing with my new toy

What Operating System are you running on your RPi[5] board? How is the RPi[5] board being powered?

I am pretty certain that the example code in the gpiozero documentation worked when I tested it soon after the RPi[5] became available.

Ref: https://gpiozero.readthedocs.io/en/stab ... html#servo


Do you get any messages indicating failure, or is it simply that the servo fails to move?

Maybe it is your wiring between the RPi board and the Servo that is wrong? How are you providing power to the servo? An MG996R is specified as a High Torque device so perhaps an RPi board alone cannot reliably supply sufficient current? https://www.towerpro.com.tw/product/mg996r/

Statistics: Posted by B.Goode — Tue Feb 13, 2024 11:46 am



Viewing all articles
Browse latest Browse all 4906

Trending Articles