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
ae3a564a4c
commit
88e678f6df
1 changed files with 3 additions and 1 deletions
|
@ -37,12 +37,14 @@ class Antennas:
|
|||
:param value: A float between -1 and 1
|
||||
"""
|
||||
|
||||
if value < 0.1:
|
||||
# if value < 0.1:
|
||||
if value ==0:
|
||||
return
|
||||
if -1 <= value <= 1:
|
||||
angle = self.map_input_to_angle(value * sign)
|
||||
|
||||
duty = 2 + (angle / 18) # Convert angle to duty cycle (1ms-2ms)
|
||||
print(duty)
|
||||
if servo == 1:
|
||||
self.pwm1.ChangeDutyCycle(duty)
|
||||
elif servo == 2:
|
||||
|
|
Loading…
Reference in a new issue