Things used in this project

Hardware components:
Microbitheart
micro:bit BBC micro:bit board
×2
Adafruit industries ada592 image 75px
USB-A to Micro-USB Cable
×2
5V USB power supply (generic)
×1
Hand tools and fabrication machines:
3drag
3D Printer (generic)

Custom parts and enclosures

Front micro:bit stand
Velcro this to the top of your handlebars, for easy removal! Modified from https://www.thingiverse.com/thing:2144500
Back micro:bit enclosure (bottom)
Back micro:bit enclosure (top)

Code

bikeface-back.pyMicroPython
Flash this onto the back micro:bit – it responds to radio commands.
# Display random emotions on your bike.
# By Alex Glow; released to the public domain.

import radio
from microbit import display, Image, sleep

stop = Image("09990:"
             "90009:"
             "90009:"
             "90009:"
             "09990")
             
danger = Image("90909:"
             "90909:"
             "90909:"
             "00000:"
             "90909")
             
left = Image("00900:"
             "09000:"
             "99999:"
             "09000:"
             "00900")
             
right = Image("00900:"
             "00090:"
             "99999:"
             "00090:"
             "00900")
             
radio.on()

while True:
    incoming = radio.receive()
    if incoming == 'left':
        display.show(left)
        sleep(500)
    elif incoming == 'right':
        display.show(right)
        sleep(500)
    elif incoming == 'stop':
        display.show(stop)
        sleep(500)
    else:
        display.show(Image.HEART)
bikeface-front-buttons.pyMicroPython
Flash this onto the front Micro:bit :)
# Display random emotions on your bike.
# By Alex Glow; released to the public domain.

import radio
from microbit import display, Image, button_a, button_b, sleep

stop = Image("09990:"
             "90009:"
             "90009:"
             "90009:"
             "09990")
             
danger = Image("90909:"
             "90909:"
             "90909:"
             "00000:"
             "90909")
             
left = Image("00900:"
             "09000:"
             "99999:"
             "09000:"
             "00900")
             
right = Image("00900:"
             "00090:"
             "99999:"
             "00090:"
             "00900")

cdbutt = 0 # Countdown from pressing 1 button, so it doesn't show arrow instead of stop sign.
cdstop = 0 # Countdown after displaying stop sign, so arrows don't display.
             
radio.on()

while True:
    cdstop = cdstop + 1
    
    if button_a.is_pressed() and button_b.is_pressed():
        cdstop = 0
        radio.send('stop')
        display.show(stop)
        sleep(500)
        display.clear()
        
    elif button_a.is_pressed() and cdstop >= 150 and cdbutt >= 150:
        radio.send('left')
        display.show(left)
        sleep(500)
        cdbutt = 0
        display.clear()
    elif button_a.is_pressed() and cdstop >= 150:
        cdbutt = cdbutt + 1
        
    elif button_b.is_pressed() and cdstop >=150 and cdbutt >= 150:
        radio.send('right')
        display.show(right)
        sleep(500)
        cdbutt = 0
        display.clear()
    elif button_b.is_pressed() and cdstop >= 150:
        cdbutt = cdbutt + 1

Credits

Tmp image 0?auto=compress%2cformat&w=60&h=60&fit=min
Alex Glow

The Hackster team's resident Hardware Nerd. I like robots, music, EEG, wearables, and languages. FIRST Robotics kid.

Contact

Replications

Did you replicate this project? Share it!

I made one

Love this project? Think it could be improved? Tell us what you think!

Give feedback

Comments

Similar projects you might like

Make Your BBC Micro:Bit Talk Using MicroPython
Easy
  • 242
  • 8

Protip

Today, I am going to show you how to make your Micro:bit talk using a very easy programming language called MicroPython.

Display Your Name On Micro-Bit Using MicroPython
Easy
  • 266
  • 6

Full instructions

In this tutorial, I am going to show you how to code BBC micro:bit using MicroPython to display your name and other basic symbols.

Lumos! NeoPixel Meets Micro:bit Meets Magic
Easy
  • 197
  • 0

Full instructions

Some geeky wand enhancement for all those Harry Potter lovers out there. Illuminate your wand.

BBC micro:bit + Blynk Smartphone App + Arduino IDE
Easy
  • 198
  • 2

Protip

Don't let your BBC micro:bit collect dust! Here is how to use it with Blynk and Arduino IDE.

magic button trick
Easy
  • 165
  • 4

Full instructions

Build a magic trick to amaze your friends that uses the micro:bit’s compass to detect a nearby magnet!

magic button trick

Team micromonsters

Getting Started with BBC Micro:Bit
Easy
  • 596
  • 10

Full instructions

This tutorial will show you the basics to get started with BBC micro bit.

Add projectSign up / LoginAbout BBC micro:bit