Sunday 7 May 2023

Kitronix Two Wheeled MOVE: Buggy Micro:Bit Code

I thought I'd document how to code the Kitronix Two Wheeled MOVE: buggy in Micro:bit.
https://kitronik.co.uk/products/5652-move-mini-mk2-buggy-kit-excl-microbit




Here's a picture of the receiver code that runs on the buggy:


It operates by listening on radio group 1 for a number from 0 to 4. These represent the commands: STOP, TURN_RIGHT, TURN_LEFT, GO_FORWARDS and GO_BACKWARDS.

The code is also available at: https://makecode.microbit.org/_ekWCkL5H6JvY

And the hex file at: https://drive.google.com/file/d/1iK9lTVpczdeoaCo-ud3FbashRBOD7bxc/view?usp=sharing

By pressing button A the radio group can be incremented. An example of frequency hoping to stop many default transmitters controlling the buggy at once on group 1. Some interesting reading here: https://en.wikipedia.org/wiki/Hedy_Lamarr

The above code also illustrates to students the use of capitals for constants (i.e TURN_LEFT represents the number 1 and saves you having to remember this

It also makes paramaterised function calls.

NOTE: You need to add the Neopixel and Kitronix Buggy extensions to the editor


The transmitter code makes use of the accelerometer on the Micro:bit to allow for control of the buggy by tilting the Micro:bit in your hand,

Here's its code:




It doesn't require any Micro:bit extensions to be loaded. It's code is available at: https://makecode.microbit.org/_5LU5ateMM3Ru

And at: https://drive.google.com/file/d/14RTpUGfLKy_Y-GtDkIxWoT1wiVrsHF9b/view?usp=sharing























No comments:

Post a Comment