Я борюсь с моей малиной. Терминал распечатывает, что есть деление с плавающей точкой на ноль, но я ничего не делю в коде. Я уже сбросил весь Pi и переустановил все. Первый запуск после сброса был успешным, но после каждого запуска отображается ошибка, приведенная ниже.
Было бы здорово, если бы вы могли мне помочь! Спасибо!
Traceback (most recent call last):
File "robot2.py", line 43, in <module>
kit.servo[servo1].angle = length1
File "/usr/local/lib/python3.6/site-packages/adafruit_servokit.py", line 150, in __getitem__
servo = adafruit_motor.servo.Servo(self.kit._pca.channels[servo_channel])
File "/usr/local/lib/python3.6/site-packages/adafruit_motor/servo.py", line 103, in __init__
super().__init__(pwm_out, min_pulse=min_pulse, max_pulse=max_pulse)
File "/usr/local/lib/python3.6/site-packages/adafruit_motor/servo.py", line 45, in __init__
self.set_pulse_width_range(min_pulse, max_pulse)
File "/usr/local/lib/python3.6/site-packages/adafruit_motor/servo.py", line 49, in set_pulse_width_range
self._min_duty = int((min_pulse * self._pwm_out.frequency) / 1000000 * 0xffff)
File "/usr/local/lib/python3.6/site-packages/adafruit_pca9685.py", line 71, in frequency
return self._pca.frequency
File "/usr/local/lib/python3.6/site-packages/adafruit_pca9685.py", line 145, in frequency
return self.reference_clock_speed / 4096 / self.prescale_reg
ZeroDivisionError: float division by zero
Traceback (most recent call last):
File "robot2.py", line 43, in <module>
kit.servo[servo1].angle = length1
File "/usr/local/lib/python3.6/site-packages/adafruit_servokit.py", line 150, in __getitem__
servo = adafruit_motor.servo.Servo(self.kit._pca.channels[servo_channel])
File "/usr/local/lib/python3.6/site-packages/adafruit_motor/servo.py", line 103, in __init__
super().__init__(pwm_out, min_pulse=min_pulse, max_pulse=max_pulse)
File "/usr/local/lib/python3.6/site-packages/adafruit_motor/servo.py", line 45, in __init__
self.set_pulse_width_range(min_pulse, max_pulse)
File "/usr/local/lib/python3.6/site-packages/adafruit_motor/servo.py", line 49, in set_pulse_width_range
self._min_duty = int((min_pulse * self._pwm_out.frequency) / 1000000 * 0xffff)
File "/usr/local/lib/python3.6/site-packages/adafruit_pca9685.py", line 71, in frequency
return self._pca.frequency
File "/usr/local/lib/python3.6/site-packages/adafruit_pca9685.py", line 145, in frequency
return self.reference_clock_speed / 4096 / self.prescale_reg
ZeroDivisionError: float division by zero
Traceback (most recent call last):
File "robot2.py", line 43, in <module>
kit.servo[servo1].angle = length1
File "/usr/local/lib/python3.6/site-packages/adafruit_servokit.py", line 150, in __getitem__
servo = adafruit_motor.servo.Servo(self.kit._pca.channels[servo_channel])
File "/usr/local/lib/python3.6/site-packages/adafruit_motor/servo.py", line 103, in __init__
super().__init__(pwm_out, min_pulse=min_pulse, max_pulse=max_pulse)
File "/usr/local/lib/python3.6/site-packages/adafruit_motor/servo.py", line 45, in __init__
self.set_pulse_width_range(min_pulse, max_pulse)
File "/usr/local/lib/python3.6/site-packages/adafruit_motor/servo.py", line 49, in set_pulse_width_range
self._min_duty = int((min_pulse * self._pwm_out.frequency) / 1000000 * 0xffff)
File "/usr/local/lib/python3.6/site-packages/adafruit_pca9685.py", line 71, in frequency
return self._pca.frequency
File "/usr/local/lib/python3.6/site-packages/adafruit_pca9685.py", line 145, in frequency
return self.reference_clock_speed / 4096 / self.prescale_reg
ZeroDivisionError: float division by zero
Traceback (most recent call last):
File "robot2.py", line 43, in <module>
kit.servo[servo1].angle = length1
File "/usr/local/lib/python3.6/site-packages/adafruit_servokit.py", line 150, in __getitem__
servo = adafruit_motor.servo.Servo(self.kit._pca.channels[servo_channel])
File "/usr/local/lib/python3.6/site-packages/adafruit_motor/servo.py", line 103, in __init__
super().__init__(pwm_out, min_pulse=min_pulse, max_pulse=max_pulse)
File "/usr/local/lib/python3.6/site-packages/adafruit_motor/servo.py", line 45, in __init__
self.set_pulse_width_range(min_pulse, max_pulse)
File "/usr/local/lib/python3.6/site-packages/adafruit_motor/servo.py", line 49, in set_pulse_width_range
self._min_duty = int((min_pulse * self._pwm_out.frequency) / 1000000 * 0xffff)
File "/usr/local/lib/python3.6/site-packages/adafruit_pca9685.py", line 71, in frequency
return self._pca.frequency
File "/usr/local/lib/python3.6/site-packages/adafruit_pca9685.py", line 145, in frequency
return self.reference_clock_speed / 4096 / self.prescale_reg
ZeroDivisionError: float division by zero