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

Python • remove jitter from servo?

$
0
0
I have some python code that works but the servo is way to jittery for my usecase, I have no idea what I'm doing wrong tho. can anywone help

Code:

from gpiozero import AngularServofrom time import sleep# Create an AngularServo object with the specified GPIO pin,# minimum pulse width, and maximum pulse widthservo = AngularServo(18)try:   while True:       # Set the servo angle to 90 degrees       servo.angle = 90       sleep(1)  # Delay for 1 second       # Set the servo angle to 0 degrees       servo.angle = 0       sleep(1)  # Delay for 1 second       # Set the servo angle to -90 degrees       servo.angle = -90       sleep(1)  # Delay for 1 second       servo.angle = 0       sleep(1)  # Delay for 1 secondfinally:   # Set the servo angle to 0 degrees before exiting   servo.angle = 0

Statistics: Posted by apigspawner — Sun Jan 19, 2025 12:43 am — Replies 0 — Views 7



Viewing all articles
Browse latest Browse all 4525

Trending Articles