Quantcast
Viewing all articles
Browse latest Browse all 1247

Python • SparkFun Auto pHAT

I tried to import qwiic to python3 to use sparkfun auto phhat to run srvo motor, but I received an error
Invalid driver class name. Unable to locate QwiicAs6212
Invalid driver class name. Unable to locate QwiicKx13X

then I tied to assign s=qwiic.PiServoHat(), and received the following error

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.11/dist-packages/pi_servo_hat.py", line 190, in __init__
self.set_pwm_frequency(_DEFAULT_SERVO_FREQUENCY)
File "/usr/local/lib/python3.11/dist-packages/pi_servo_hat.py", line 296, in set_pwm_frequency
if self.PCA9685.set_pre_scale(frequency) == True:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/qwiic_pca9685.py", line 1255, in set_pre_scale
mode1 = self._i2c.readByte(self.address, MODE1)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/qwiic_i2c/linux_i2c.py", line 190, in readByte
raise ioErr
File "/usr/local/lib/python3.11/dist-packages/qwiic_i2c/linux_i2c.py", line 183, in readByte
data = self._i2cbus.read_byte_data(address, commandCode)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/smbus2/smbus2.py", line 433, in read_byte_data
ioctl(self.fd, I2C_SMBUS, msg)
OSError: [Errno 121] Remote I/O error

I tried to use s=pi_servo_hat.PiServoHat() and received the folloing error

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: module 'qwiic' has no attribute 'pi_servo_hat'. Did you mean: 'PiServoHat'?
>>> s=pi_servo_hat.PiServoHat()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.11/dist-packages/pi_servo_hat.py", line 190, in __init__
self.set_pwm_frequency(_DEFAULT_SERVO_FREQUENCY)
File "/usr/local/lib/python3.11/dist-packages/pi_servo_hat.py", line 296, in set_pwm_frequency
if self.PCA9685.set_pre_scale(frequency) == True:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/qwiic_pca9685.py", line 1255, in set_pre_scale
mode1 = self._i2c.readByte(self.address, MODE1)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/qwiic_i2c/linux_i2c.py", line 190, in readByte
raise ioErr
File "/usr/local/lib/python3.11/dist-packages/qwiic_i2c/linux_i2c.py", line 183, in readByte
data = self._i2cbus.read_byte_data(address, commandCode)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/smbus2/smbus2.py", line 433, in read_byte_data
ioctl(self.fd, I2C_SMBUS, msg)
OSError: [Errno 121] Remote I/O error

Statistics: Posted by Zerobite — Mon Dec 09, 2024 12:47 am



Viewing all articles
Browse latest Browse all 1247

Trending Articles