Brick Remote

Drive your building-block car with a computer or a tablet. Steer it, race it, teach it to dance, or draw a road for it to follow!

The Brick Remote app with a big green steering wheel, forward and back buttons, and speed 1, 2, 3

๐ŸŽฌ Watch it work

  1. Press the button on your brick. It lights up.
  2. Brick Remote finds it and shows the steering wheel.
  3. Drive!

๐Ÿงฐ What you need

Just three things.

๐Ÿงฑ

Your motor brick

The battery box with motor plugs A, B, C and D. It usually comes with the XP Block app and says "Smart creative module" in the leaflet.

๐Ÿ’ป

A computer

With Bluetooth: a Raspberry Pi, a laptop or a desktop. A tablet or phone can be the remote too.

๐Ÿง‘โ€๐Ÿ”ง

A grown-up

Just for the first setup. After that, you're the driver!

๐Ÿš€ Get going in 4 steps

Steps 1 and 2 only happen once.

Get Brick Remote grown-up

Install it with Python:

pip install "brickremote[web]"

Or download the code and use ./run.sh, which sets everything up by itself the first time.

Build your car

Plug the driving motor into port A and the steering motor into port D. That's how the ready-made car in the box is built.

Switch on your brick

Press the power button. The light starts blinking: it's waiting for you!

Start the remote

brickremote web

Open the address it shows in a web browser. On a tablet, use the one that ends in :8080. When the brick is found, the light stops blinking and you can drive!

Like typing more than clicking? Just run brickremote for the keyboard version.

๐ŸŽฎ Four ways to play

Switch between them with the buttons at the top.

Car screen with steering wheel
๐Ÿš— Car

Be the driver

Hold FORWARD to go, and turn the steering wheel. Let go and the wheel springs back to the middle, just like a real car.

  • Pick speed 1 (slow), 2 or 3 (zoom!)
  • Or use the arrow keys
Ports screen with two joysticks
๐Ÿ•น๏ธ Ports

Control every motor

Built a crane, a robot or a tank? Two joysticks control all four motors, one for A and B, one for C and D.

  • Pair makes two motors move together, great for tanks
  • Reverse fixes a motor that turns the wrong way
Program screen with blocks
๐Ÿงฉ Program

Teach it a trick

Tap the coloured blocks to build a list of moves, then press RUN and watch your creation do it all by itself.

  • Blue blocks move motors
  • Orange blocks wait and repeat
  • Green blocks change speed
Path screen with a grid and a route
๐Ÿ—บ๏ธ Path

Draw a road

Tap squares on the grid to draw where the car should go. Each square is half a metre. Press GO! and off it drives.

  • Measure your car once, then set the speed and turning sliders for perfect paths

๐Ÿ’ƒ Programs to try

Copy one into the Program screen and press RUN. Then change the numbers and see what happens!

๐Ÿ› The wiggle

Forward and back, again and again.

gear 2
repeat 4
  a + 0.5
  a - 0.5
end

๐ŸŒ€ Spinning dance

Steer hard and drive in circles.

repeat 3
  d +     # steer left and keep it there
  a + 2   # drive for 2 seconds
  stop
  wait 0.5
end

๐Ÿข๐Ÿ‡ Slow, then fast

The tortoise and the hare.

gear 1
a + 2
gear 3
a + 1
stop

โŒจ๏ธ Keyboard keys

For the keyboard version (brickremote). Most of them work in the web version too.

โ†‘โ†“ drive forward / back
โ†โ†’ steer left / right
123 speed
Tab next screen
WASD ports A and B
IJKL ports C and D
space STOP everything
Q quit
STOP

Safety first!

The big red STOP button (or the space bar) stops every motor straight away. Drive on the floor, not on the table, and keep fingers away from turning wheels and gears.

๐Ÿง‘โ€๐Ÿ”ง For grown-ups

Brick Remote is free, open-source software (MIT licence). It works with the low-cost Bluetooth LE motor modules that advertise as JG_JMC-xxxx and are normally used with the XP Block phone app. It runs on Linux (including Raspberry Pi), macOS and Windows.

More than an app

It is also a small Python library, if you want to build your own projects:

import asyncio
from brickremote import JMCModule

async def main():
    async with JMCModule() as m:
        await m.run(2, a=255)   # port A forward for 2 seconds

asyncio.run(main())

Good to know

  • The brick switches itself off after about ten minutes without commands.
  • Ports A and B share one speed setting, and so do C and D.
  • The web remote stops the motors by itself if the browser goes away (closed tab, lost Wi-Fi).
  • This is an independent project. It is not made by, or connected to, the makers of the XP Block app or the bricks.

Code, protocol notes and the full command reference are in the project on GitHub.