Micro:bit Gamepad Expansion Board SKU: DFR0536

From DFRobot Electronic Product Wiki and Tutorial: Arduino and Robot Wiki-DFRobot.com

Category.png Home > Development Boards > micro:bit

micro:bit Gamepad Expansion Board

Introduction

Micro:bit gamepad is an expansion gamepad based on micro:bit. You only need to plug in the micro:bit, it will turn into a wireless remote controller or a wireless game console. This product packaged with acrylic plate, that giving it a good feel and no longer feels like a bare circuit board. The gamepad has a total of 8 buttons, the left side have up, down, left, right four buttons, the right side has X, Y two buttons, and two buttons A, B are in the front of the gamepad. The gamepad also has programmable built-in vibration motor, buzzer, and LED. Using graphical programming, it will turn into a multimedia vibration controller or multimedia interactive game console instantly. The programming platform supports MakeCode graphical programming and python. It is a very suitable tool for both beginners and masters.

Specification

  • Operating Voltage: 3VDC (2 AAA batteries)
  • Number of Buttons: Up, Down, Left, Right, X, Y, A, B Total 8 programmable buttons
  • Onboard Vibration motor × 1
  • Onboard LED × 1
  • Onboard Buzzer × 1
  • Acrylic Floor x 1
  • Acrylic Panel × 1
  • Battery Box with Cover × 1
  • Velcro × 2
  • Copper Cylinder × 4
  • Screw × 8
  • Big Button ×6
  • Small Button× 2
  • Dimension:148x57(mm)/ 5.83*2.24in


Function Description

DFR0536-2.png


Function Description
LED Control pin P16
Vibration Motor Control pin P12
Buzzer Control pin P0
PWR Power Indicator
Switch Turn off the power
Opearting Voltage 3V~3.7V(2x AAA batteries)


MakeCode Graphical Programming

The basic tutorial of MakeCode:

  1. Enter MakeCode
  2. Find Advanced > Add package
  3. Copy the library link and paste it in the option box
  4. Click the gamepad, and you can find a new icon on the right.

The programming of event trigger

Event Trigger Mode-Press and Release Buttons

Result: When the X is pressed, the vibration motor vibrates and the LED lights up; when the X is released, the vibration motor stops and the LED turns off.

Event Trigger Mode-Click Buttons

Result: When the X is pressed, the vibrating motor vibrates and the LED lights up; when the Y is pressed, the vibrating motor stops and the LED turns off.

The Programming of Cyclic Query

Event Trigger Mode-Click Buttons

Result: When the X is pressed, the vibration motor vibrates at the strength of 175, and when the X is released, the vibration motor stops vibrating.

The Example of MakeCode

Rock-Paper-Scissors

Graphical source program: Rock-Paper-Scissors

Rock-Paper-Scissors

Execution of the Program:
1. First, you should set the two main boards are in the 1th wireless group, so that they can communicate with each other.
2. When the left button is pressed, LED dot matrix displays the scissors, and sends the number 1.
3. When the down button is pressed, LED dot matrix displays the rock, and sends the number 2.
4. When the right button is pressed, LED dot matrix displays the paper, and sends the number 3.
5. In the infinite loop, compare the wireless received numbers with your own Numbers;if you lost,it will display “×", if you win, it will show "√".
6. After showing the result, clear all data.

Yacht

Graphical source program: Dice Game

Yacht

Execution of the Program:
1. Set the wireless to group 1 when booting, and initialize item to 0.
2. When the vibration is detected, turn off the LED and initialize the value to 0, and use the acceleration value to produce a random number between 1 and 6.
3. Incremental display from 0 to randomly generated number on the LED dot matrix, play the pitch and vibrate motor.
4. Send 1~6 random numbers to other main boards via wireless.
5. Comparing the random number with the received number. If it is less than the received number, turn off the light, otherwise turn on the light.

Remote Control Handle

Graphical source program of handle: Gamepad
Graphical source program of car: Mobile Platform

Handle

Execution of the Program:
1. Set the wireless to group 1.
2. When different buttons are pressed, send different numbers to let the car performs different actions.
3. When the button is released, the number 0 is sent to make the car stop.

car

Execution of the Program:
1. Set the wireless to group 1.
2. When receiving different numbers, let the car perform different actions such as forward, backward, turn left, turn right.


FAQ

For any questions, advice or cool ideas to share, please visit the DFRobot Forum.


More Documents

DFR0536 Dimension.png

DFshopping car1.png Get [Product link Micro:bit Gamepad Expansion Board] from DFRobot Store or DFRobot Distributor.