This part of the schematic should be what you’re after.
As Pixmusic said, If you could let us know the exact error you’re facing that would greatly help us be able to point you in the right direction.
I have a suspicion that it’s not letting you install the library due to changes in how Bookworm handles python libraries and using the Python Virtual Environment.
The PyPi page for the library does have a mostly Cut and Paste way to get it working but I would highly recommend looking into understanding what each command is doing.
Thanks for that. I have installed it successfully: pip3 install adafruit-circuitpython-motorkit in the directory stepper2.
But when I run a python script in that directory, I get the following error:
traceback (most recent call last):
File “/home/pi/stepper2/stepper2.py”, line 2, in
from adafruit_motorkit import MotorKit
ModuleNotFoundError: No module named ‘adafruit_motorkit’
Is there anything you might suggest as to what I am doing wrong?
This is just the simple code in the script:
import time
from adafruit_motorkit import MotorKit
That error is from the Libary not being installed in the Virtual Environment you are trying to run the script in.
I would recommend following the steps in our guide here for creating a Virtual Environment in Thonny and installing libraries using Thonny to that environment.
The AdaFruit Circuitpython Motorkit library is available through the Thonny Library manger.
Thanks so much for your help. That is tremendous support. I have gotten the step motor working in the virtual environment using Thonny to set it all up. By the way, is it normal for the ICs on the motor hat to get very hot ?
I am just wondering if you might be able to help with a further problem of having to run the hat in a virtual environment. In my project, I am wanting to combine the stepper function with the camera.
Thus I installed picamera2 into my virtual environment using Thonny.
When I open my picamera2 script in Thonny within the virtual environment, I get "ModuleNotFoundError: No module named ‘picamera2’.
When I open terminal from Thonny in the virtual environment, picamera2 is found as rpicam-hello works.
When I run the script in the normal (ie not virtual) environment then the script works.
Have you any suggestions for how to get the picamera2 script working in Thonny within the virtual environment so that it can combine the stepper code with the picamera2 code.