VELOCITY ARENA HARDWARE GUIDE

00Hardware

micro:bit + MakeCode.

Everything you need to program your Velocity Arena bot. Hardware guides, code editors, and the JavaScript behind every stat formula.

Getting started

Open your tools

Bookmark these. You'll use them every day.

Your stat formulas in JavaScript

These are the exact lines your bot runs. Every stat card formula translates directly to code.
Stat Formula JavaScript
Speed Motor power = (Speed / 20) × 100 roamPower = SPEED * 100 / 20
Power (charge) Charge speed = Power² / 2 chargePower = POWER * POWER / 2
Power (follow-through) Follow through = Power × 80 FOLLOW_THROUGH_MS = 120 + POWER * 35
Turning (segments) Arc segments = Turning arcSegments = TURNING
Turning (ratio) Turn ratio = 0.2 + (Turning × 0.02) turnRatio = 0.2 + TURNING * 0.02
Endurance P(t) = 100 − (20 − E) × 1.5 × t DECAY_RATE = 20 - ENDURANCE
Budget constraint

Your four stats must always total exactly 20: SPEED + ENDURANCE + TURNING + POWER = 20. The dashboard enforces this. If you're over budget, reduce one stat before saving.

How to get code onto your bot

Three steps, every time.
Step 1 — Write

Open MakeCode. Edit your stat values at the top of the code. Change let SPEED = 5 to whatever your stat card says.

Step 2 — Download

Click the purple Download button. A .hex file saves to your computer.

Step 3 — Flash

Plug in the micro:bit via USB. It shows up as a drive called MICROBIT. Drag the .hex file onto that drive. The yellow LED blinks while it loads. When it stops blinking, your bot is ready.

JavaScript basics for Velocity Arena

You don't need to know JavaScript to use MakeCode blocks. But if you switch to the JS view, here's what you'll see.
Concept What it looks like What it does
Variable let SPEED = 5 Stores a number with a name. Change the number, change the bot.
Function function computeStats() { ... } A reusable block of code. Call it by name to run it.
If/Else if (borderSide > 0) { handleBorder() } Makes a decision. If the condition is true, run the code inside.
Loop for (let i = 0; i < TURNING; i++) { ... } Repeats code a set number of times. TURNING controls how many arc segments.
Math POWER * POWER / 2 Same operations as your stat card. JavaScript uses * for multiply and / for divide.
Event input.onButtonPressed(Button.A, function() { ... }) Runs code when something happens. Button A starts the match.

Common problems

Check these before asking your facilitator.
Bot doesn't move

Is the battery plugged in and charged? Is the power switch on? Did you download the .hex file to the MICROBIT drive (not your Downloads folder)?

Bot moves but too slow

Check your Speed stat in the code. let SPEED = 2 gives only 10% motor power. Your stat card tells you the right number.

Bot spins in circles

Your Turning value might be too high or the turn ratio formula is off. Check turnRatio = 0.2 + TURNING * 0.02 and make sure your TURNING stat matches your card.

Bot dies too fast

Low Endurance = fast decay. ENDURANCE = 2 means your bot loses power at 27% per minute. If you can't finish a 3-minute match, plan for more Endurance the next time you set your loadout.