Google Chat: zj734465502@gmail.com
+86-0755-88291180
sales01@spotpear.com
dragon_manager@163.com
services01@spotpear.com
manager01@spotpear.com
WhatsApp:13246739196
This is a motor driver module designed for the BBC micro:bit. Can drive 2 DC motots and 3 steering gears
PIN | Description |
---|---|
Vcc | Power (6~12V) |
GND | Ground |
A1 | positive pole of motor A |
A2 | negative pole of motor A |
B1 | positive pole of motor B |
B2 | negative pole of motor B |
P0 | control pin P0 of steering gear |
P1 | control pin P1 of steering gear |
P2 | control pin P2 of steering gear |
Micor:bit has variety of programming methods like mbed, micropython, typescript and other programming methods, as well as code online websites which are abundant.
The official recommendation are two programming methods: typescript and micropython. Typescript is the graphical programming language.
Typescript is a kind of graphical programming, its website is that: https://makecode.microbit.org/#
You can clone the package of Motor Driver HAT for micro;bit from github. Click More..->Add Package, then copy the URL to the Edittext. https://github.com/waveshare/pxt-Motor
Control two motors at the same time, and set their rotating direction and speed
Stop motor when button A is pressed
Control servo to rotate in certain angle.
There are also some block in Avandced->More which can be used to control servo
You can get more information about python programming of micro:bit on this web page: https://microbit-micropython.readthedocs.io/en/latest/index.html
We provide python codes for this moudle, you can download and have a try.
Upzip the demo code you download and open the file motor.py which is under python directory with software mu.
Stop
Control servo to rotate in certian angle
Temp=angle/2+25 is duty ratio, its range is 0~1023.
Example:
Motor1 moves forward, Motor2 moves backward, servo1 rotate 50 degree, servo2 rotate 150 degree.