Dear
I have some problem in using a Stepper Motor HAT module.
Thanks in advance for your proactive help.
It consists of:
- Raspberry Pi 5 module
- 28BYJ-48, 5VDC stepper motor
- 12V 3A Switching Adapter for motor
- 5V 5A Adapter for Raspberry Pi 5
- Fan
I think the motor pins are connected well like below
I have run the following command according to your instructions
wget https://github.com/joan2937/lg/archive/master.zip
unzip master.zip
cd lg-master
sudo make install
And I have installed lib. of python3
sudo apt-get update
sudo apt-get install python3-pip
sudo pip install RPi.GPIO
sudo apt-get install python3-smbus
using 'halfstep'
D0, D1, D2(S0 ,S1 ,S2 in my module) was set to ( 1, 0, 0 )
my codes are :
import RPi.GPIO as GPIO
import time
from DRV8825 import DRV8825
try:
Motor1 = DRV8825(dir_pin=13, step_pin=19, enable_pin=12, mode_pins=(16, 17, 20))
Motor1.SetMicroStep('hardward','halfstep')
Motor1.TurnStep(Dir='forward', steps=200, stepdelay = 0.005) #default 0.005
time.sleep(0.3)
Motor1.Stop()
except:
print ("\nMotor stop")
Motor1.Stop()
exit()
And DRV8825.py was not changed except 'print'
When I run this code
but the stepper motor
I would appreciate it if you could tell me how to solve this problem.
If you need any more information, please contact me by mail.
regards