Example Code for micro:bit-Control Maqueen Lite via Switch Quantity

Use the Gamepad’s joystick to operate Maqueen to move forward and backward, turn left and right. Press the up and down buttons to control the movement of the gripper, the left and right buttons to turn the robot car’s LEDs on/off. Install the gripper on Maqueen Lite and connect it to port S1.

Hardware Preparation

  • [DFR0536]GamePad for microbit ×1
  • micro:bit ×1
  • Maqueen Lite ×1
  • Gripper ×1 (connect to Maqueen Lite port S1)

Software Preparation

  • MakeCode programming platform address: https://makecode.microbit.org
  • GamePad library: You can directly program this product on MakeCode without any third-party libraries.

Wiring Diagram

Install the gripper on Maqueen Lite and connect it to port S1. Plug the micro:bit into the GamePad for microbit.

Other Preparation Work

Download the program to the micro:bit motherboard and plug the motherboard into the gamepad.

Sample Code

Program for Maqueen Lite: https://makecode.microbit.org/_Vot7AfUW7g6D

Microbit Gamepad Expansion Board

Program for GamePad: https://makecode.microbit.org/_PtgDRughPidF

Microbit Gamepad Expansion Board

Result

Run the program, toggle the rocker, and Maqueen Lite executes as follows:

Microbit Gamepad Expansion Board

Additional Information

Was this article helpful?

ON THIS PAGE

TOP