Skip to main content

Software Library Documentation

The micro:bit XGO-Rider uses the micro:bit as the main control board, and its programming platform uses the makecode platform. To facilitate users to program and use the micro:bit XGO-Rider, ELECFREAKS team has developed an independent programming library file specifically for the micro:bit XGO-Rider. The following will introduce the function and parameter range of each programming command in detail:

FunctionOrderParameterDetailed explanation
Basic ControlParameter 1 type: drop-down options
Parameter 1 range: default P14
Parameter 2 type: drop-down options
Parameter 2 range: default P13
Set the communication serial port between micro:bit and XGO-Rider, the default is TX: P14, RX: P13.
Parameter 1 type: drop-down options
Parameter 1 range: normal mode, cyclical pattern1, cyclical pattern2.
Set the performance mode of XGO-Rider. XGO-Rider will perform a set of actions.
Parameter 1 type: drop-down options
Parameter 1 range: playPendulum,AdvanceAndRetreat,
upsAndDowns,TetragonalSnake,
LiftRotation,CircularSloshing
Set XGO-Rider to perform standard actions.
NoSet XGO-Rider back to its initial state.
Return value: number
Return value range: 0~100
Get the current charge level of XGO-Rider.
Return value: string
Get the current firmware version number of XGO-Rider.
Parameter 1 type: drop-down options
Parameter 1 range: all, 1, 2, 3, 4
Parameter 2 type: drop-down options
Parameter 2 range: 16 common colors
Set the color of XGO-Rider's lamp.
Parameter type: string
Parameter range: a~z,A~Z,_<br /
Set the Bluetooth name of XGO-Rider.
Parameter 1 type: number
Parameter 1 range: 0~255
Parameter 2 type: number
Parameter 2 range: 0~255
Parameter 3 type: number
Parameter 3 range: 0~255
Set the color of the rainbow light ring on the XGO-Rider driver board.
Steering gear controlParameter Type: Drop-down options
Parameter Range: On/Off
Set whether the dynamic balance state of the XGO-Rider is turned on. If the dynamic balance state is turned on, the XGO-Rider will adjust its posture in real time to maintain body balance.
Parameter Type: Drop-down options
Parameter Range: Enter/Complete
Set XGO-Rider to enter calibration mode and complete calibration. Calibration means resetting the initial angle of the XGO-Rider's servo. After entering the calibration state, the user can adjust the servo angle by himself. After completing the calibration, XGO-Rider will maintain the state of calibration in the default stance.
Parameter type: drop-down options
Parameter range: roll/pitch/yaw
Get the angle data of the XGO-Rider body in the roll/pitch/yaw directions.
Parameter type: number
Parameter range: -20~20
Set the height of the XGO-Rider body for rising and falling adjustments.
Parameter 1 type: number
Parameter 1 range: -100~100
Set the left and right tilt angle of the XGO-Rider body.
Motion ControlParameter 1 type: drop-down option
Parameter 1 range: forward/backward
Parameter 2 type: number
Parameter 2 range: 0~100
Parameter 3 type: number
Parameter 3 range: 0~
Set XGO-Rider to run forward or reverse at a set speed for a set time.
Parameter 1 type: drop-down option
Parameter 1 range: clockwise/counterclockwise
Parameter 2 type: number
Parameter 2 range: 0~100
Parameter 3 type: number
Parameter 3 range: 0~
Set the XGO-Rider to run clockwise or counterclockwise at a set speed for a set time.
Parameter 1 type: number
Parameter 1 range: 2~4
Set up the XGO-Rider to squat and raise/lower in a set timed cycle.
Parameter 1 type: number
Parameter 1 range: 2~4
Set the XGO-Rider to rock left and right at a set time period.