|Software apps and online services:|
It's the Stupid Shit No One Needs and Terrible Ideas Hackathon! (caution: NSFW)
Y'know how you're on your bike, or in your car, and all you can really do is use your horn, bell, or finger to give feedback to other drivers? What if there was a better way?
This is not a better way.
This project uses one Micro:bit (mounted on your handlebars) to display a random emotion on another Micro:bit (mounted on the back of your vehicle). It's modded from some awesome example radio code.
In order to use the radios, you currently need to program in MicroPython using the Mu editor. Just scroll down and copy the code, paste it into Mu, plug in your :bit, and hit Flash!
Do this with both boards, tape them to your bike with a power-supply each, and you're ready to hit the town.
- The code imports a bunch of useful libraries with functions we can use.
- Then, it creates a database of different faces/images to display.
- It turns the radio on so the two modules can communicate.
- Then, it starts an infinite loop that will run as long as the Micro:bit has power. When the button on Board 1 is pressed, it will display a random face and send a signal to the other board. When Board 2 receives the message, it will display a different random face.
- You're welcome.
Presentation video, thanks to Mitch Altman:
# A micro:bit Firefly # By Nicholas H.Tollervey. Released to the public domain. Modded by Alex Glow to display random emotions on your bike. import radio import random from microbit import display, Image, button_a, sleep faces = [Image.HAPPY, Image.SAD, Image.CONFUSED, Image.ANGRY, Image.ASLEEP, Image.SURPRISED, Image.SILLY, Image.FABULOUS, Image.MEH, Image.HEART, Image.SKULL ] # The radio won't work unless it's switched on. radio.on() # Event loop. while True: # Button A sends a "flash" message. if button_a.is_pressed(): radio.send('flash') # a-ha display.show(random.choice(faces)) # Read any incoming messages. incoming = radio.receive() if incoming == 'flash': display.show(random.choice(faces)) # of course this does not actually display the same face as your "signal" micro:bit
Did you replicate this project? Share it!I made one
Love this project? Think it could be improved? Tell us what you think!