Skip to main content

1.6

Major VersionM

by Pete Prodoehl

Introduction

Control your Tank using Bluetooth from a phone or tablet.

Using a GamePad (or "DPAD") controller you can make the Tank forward & backward, and spin in either direction. You can also open and close the Gripper and adjust the speed of the Tank.

Video Overview

  1. You can control your Tank using Bluetooth from a phone or tablet along with an app that supports the micro:bit's Bluetooth Messaging Event System.
    • You can control your Tank using Bluetooth from a phone or tablet along with an app that supports the micro:bit's Bluetooth Messaging Event System.

    • If you are using an iPhone or iPad you can use the GamePad (or "DPAD") controller found in the “Monitor & Control” section of the micro:bit iOS app.

    • Find the iOS app here: https://apps.apple.com/gb/app/micro-bit/...

    • If you are using an Android phone or tablet you can use “Bitty Controller” which has its own “DPAD" controller option.

    • Find Bitty Controller in the Google Play store here: https://play.google.com/store/apps/detai...

    • Find more information about Bitty Controller here: https://bittysoftware.blogspot.com/p/app...

  2. The GamePad may look familiar if you've ever used a video game controller.
    • The GamePad may look familiar if you've ever used a video game controller.

    • The GamePad will control the Rover in the following manner:

    • 1 will move forward, 2 will move backwards.

    • 3 will spin to the left, 4 will spin to the right.

    • C will open the gripper, D will close the gripper.

    • A will increase speed, B will decrease speed.

    • Keep in mind you can change what any of these controls do by editing the code.

  3. If you've never used a micro:bit before you'll want to check out this guide:  Bit Board V2 Setup and Use
  4. You'll need to pair the phone or tablet with the micro:bit in your Tank.
    • You'll need to pair the phone or tablet with the micro:bit in your Tank.

    • Please see the extensive guide to pairing provided on the makecode.microbit.org web site: https://makecode.microbit.org/v0/referen...

    • Once you pair your device with the micro:bit on the Tank you can use the GamePad to control it!

  5. The on start block has two commands to enable the Bluetooth services we need. The rest of the code in the on start block is just like other Tank code.
    • The on start block has two commands to enable the Bluetooth services we need.

    • The rest of the code in the on start block is just like other Tank code.

    • The other blocks are all on event blocks, which are looking for data from the MES_DPAD_CONTROLLER_ID with a specific value.

    • Besides the on start block, each dark gray block looks for a button to be down or up, and reacts appropriately.

    • While these Control blocks look a bit more complex than other blocks, they are pretty easy to explore and use in your code.

Finish Line

Pete Prodoehl

Member since: 03/04/2020

331 Reputation

298 Guides authored

0 Comments

Add Comment

View Statistics:

Past 24 Hours: 1

Past 7 Days: 2

Past 30 Days: 15

All Time: 337