Running servoTest.py in Thonny I get the following result, does any one have an idea of the problem
I am trying to run a pan and tilt camera setup using i2c7 output.
“Terminal output for i2c test”
ali@rock-4c-plus:~$ sudo i2cdetect -y -r 7
[sudo] password for ali:
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: – -- – -- – -- – --
10: – -- – -- – -- – -- – -- – -- – -- – --
20: – -- – -- – -- – -- – -- – -- – -- – --
30: – -- – -- – -- – -- – -- – -- – -- – --
40: 40 – -- – -- – -- – -- – -- – -- – -- –
50: – -- – -- – -- – -- – -- – -- – -- – --
60: – -- – -- – -- – -- – -- – -- – -- – --
70: 70 – -- – -- – -- –
“servoTest.py in Thonny”
from adafruit_servokit import ServoKit
sKit=ServoKit(channels=16)
sKit.servo[0].angle=45
“Error in Thonny”
Python 3.9.2 (/usr/bin/python3)
%Run servoTest.py
ImportError
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File “/home/ali/servoTest.py”, line 1, in
from adafruit_servokit import ServoKit
File “/usr/local/lib/python3.9/dist-packages/adafruit_servokit.py”, line 35, in
import board
File “/usr/local/lib/python3.9/dist-packages/board.py”, line 251, in
from adafruit_blinka.board.radxa.rockpi4 import *
File “/usr/local/lib/python3.9/dist-packages/adafruit_blinka/board/radxa/rockpi4.py”, line 7, in
from adafruit_blinka.microcontroller.rockchip.rk3399 import pin
File “/usr/local/lib/python3.9/dist-packages/adafruit_blinka/microcontroller/rockchip/rk3399/pin.py”, line 7, in
from adafruit_blinka.microcontroller.generic_linux.libgpiod_pin import Pin
File “/usr/local/lib/python3.9/dist-packages/adafruit_blinka/microcontroller/generic_linux/libgpiod_pin.py”, line 8, in
raise ImportError(
ImportError: libgpiod Python bindings not found, please install and try again! See https://github.com/adafruit/Raspberry-Pi-Installer-Scripts/blob/master/libgpiod.sh