mirror of
https://github.com/apirrone/Open_Duck_Mini_Runtime.git
synced 2025-09-02 19:23:54 +00:00
trying to fix antennas twitching
This commit is contained in:
parent
fc4e7ac33c
commit
3fdb5f4dda
1 changed files with 3 additions and 2 deletions
|
@ -47,8 +47,8 @@ class Antennas:
|
|||
elif servo == 2 and not self.pwm2_set:
|
||||
self.pwm2.ChangeDutyCycle(7)
|
||||
self.pwm2_set = True
|
||||
return
|
||||
if -1 <= value <= 1:
|
||||
|
||||
elif -1 <= value <= 1:
|
||||
angle = self.map_input_to_angle(value * sign)
|
||||
|
||||
duty = 2 + (angle / 18) # Convert angle to duty cycle (1ms-2ms)
|
||||
|
@ -63,6 +63,7 @@ class Antennas:
|
|||
# time.sleep(0.01) # Allow time for movement
|
||||
else:
|
||||
print("Invalid input! Enter a value between -1 and 1.")
|
||||
|
||||
|
||||
def stop(self):
|
||||
self.pwm1.stop()
|
||||
|
|
Loading…
Reference in a new issue