ステッピングモーター(stepper motor) Python3ライブラリ
- マルチスレッド版
- 回転中でも制御可能。
- シングルスレッド版
- 指定されたカウントまでブロックし、他の操作ができない。
- 本体: Raspberry Pi
- モータードライバー: DRV8835, ULN2003
- ステッピングモーター: 28BYJ-48-5V
- プログラミング言語: Python3
- GPIO制御ライブラリ: pigpio
Install
$ cd ~
$ python3 -m venv env1
$ cd env1
$ . ./bin/activate
(env1)$ git clone https://github.com/ytani01/StepperMotor.git
(env1)$ cd StepperMotor
(env1)$ pip install -U pip setuptools wheel
(env1)$ hash -r
(env1)$ pip install .
Run test program
(env1)$ sudo pigpiod
(env1)$ python -m stepmtr PIN1 PIN2 PIN3 PIN4
Sample program sample.py
配線と、引数の順番の違いに注意!
AIN1 -> IN1
AIN2 -> IN2
BIN1 -> IN3
BIN2 -> IN4
$ python3 -m pydoc stepmtr
呼び出し階層
-----------------
| StepMtrTh class |
|-----------------|
| StepMtr class |
|-----------------|
| pigpio class |
-----------------