1.5 Superbit MicroPython API

www.yahboom.com
Yahboom Superbit MicroPython API
Note:
The superbit-micropython library is a driver for the superbit expansion board added
to the official microbit-microPython library. Other APIs can be found on the
microbit-microPython website.
URL: https://microbit-micropython.readthedocs.io/en/latest/
A.Superbit library
Import superbit_micropython library
import super:bit
superbit.motor_control(a, b, 0)
Function:
Control the motor on the expansion board to send PWM
Parameter:
a: Select the corresponding motor port (superbit.M1-M4)
b: PWM duty cycle (-255~255, negative value is reverse, positive value is
positive)
superbit.motor_control_dual(a, b, c, d, 0)
Function:
Control two motors on the expansion board to send PWM at the same time
Parameter:
a: Select the corresponding motor1 port (superbit.M1-M4)
b: Select the corresponding motor2 port (superbit.M1-M4)
c: PWM duty cycle of motor1(-255~255, negative value is reverse, positive value
is positive)
d: PWM duty cycle of motor2(-255~255, negative value is reverse, positive value
is positive)
superbit.servo270(a, b)
Function:
Control the control the 270 ° servo on servo interface on the expansion board
Parameter:
a: Select the servo port number (superbit.S1-S8)
b: Set the control angle (0-270)
superbit.servo180(a, b)
Function:
Control the control the 180 ° servo on servo interface on the expansion board
Parameter:
a: Select the servo port number (superbit.S1-S8)
b: Set the control angle (0-180)

Summary of content (2 pages)