Tinybit MicroPython API
www.yahboom.com
Parameter:
a is the speed of left motor of the car, range: 0 ~ 255
!Note: car turn left is right wheel stop and left wheel advance,so we only input left
speed.
Eg: tinybit.car_right(255) // The car will turn right with 255 speed
6、Car spin left
method1: tinybit.car_spinleft(s)
method2: tinybit.car_spinleft(a,b)
Function: Control the car spin left
One parameter:
A single parameter s is the speed of the two motors of the car, range: 0 ~ 255
Two parameters:
a is left motor speed,range is 0‐255.
b is right motor speed,range is 0‐255.
Eg1: tinybit.car_spinleft(255) // The car will spin left with 255 speed
Eg2: tinybit.car_spinleft(255, 255) //The car will spin right with 255 speed
7、Car spin right
method1: tinybit.car_spinright(s)
method2: tinybit.car_spinright(a,b)
Function: Control the car spin right
One parameter:
A single parameter s is the speed of the two motors of the car, range: 0 ~ 255
Two parameters:
a is left motor speed,range is 0‐255.
b is right motor speed,range is 0‐255.
Eg1: tinybit.car_spinright(255) // The car will spin right with 255 speed
Eg2: tinybit.car_spinright(255, 255) //The car will spin right with 255 speed
8、Car stop tinybit.car_stop()
Function: Control the car stop
9、RGB search light tinybit.setMotorPWM(a, b, c)
Function: Set motor PWM value
Parameters:
a: the left motor speed (‐255 ~ 255), positive number is forward, negative
number is backward, zero is stop
b: the right motor speed (‐255 ~ 255), positive number is forward, negative
number is backward, zero is stop
c: delay time (ms)
Eg: tinybit.car_setMotorPWM(255, ‐255, 1000) //Left motor rotates forward, right
motor rotates reverse 1000ms with 255 speed.




