I had been playing a bit with the micro:bit and mu, a micro python editor with a specific “mode” for the micro:bit. In it’s latest version it comes with a serial plotter and I wanted to understand how to use it (hint: send data as tuples: print((x, y, z)), with double brackets). As a side result, the concept of the micro:bit based bicycle helmet directional indicator, as described in the following, was developed.
Four patterns are displayed on the micro:bit’s 5x5 LED display:
In the resting state a nice, randomized “firefly” pattern is generated. You may adjust the parameters to make it run faster or slower, or more or less dense. Then there are “turn right” or “turn left” indicators in form of moving arrows. They are activated by the buttons on the micro:bit or external buttons connected to pins 0 and 1 or, in another version of the script, by bending it left or right. If both buttons, or pins, are activated at the same time, or the device is bent backwards in the other script, an “alert” or “break” pattern is displayed.This pattern-displaying micro:bit might be used as a directional indicator for biking. You can fix it on your helmet or on your bike. You may control it with two switches attached to the micro:bit via some cables. Or it can be controlled by the build-in gravity sensors and your head’s position. So if you lean you head to the right or left, the corresponding “turn” patterns are displayed, if you bend your head back, the “alert/break” pattern is displayed, and if none of the thresholds are reached, the “firefly” pattern is generated.
For those working with MakeCode, I added a block script in the last step, which can be copied to the micro:bit.
Please keep in mind:
While this project might be helpful for your safety, please make sure that you always give clear indications where you want to drive using your hands and arms. The concept has not been tested extensively on the road and was intended as a programming example only. Use it on your own risk. Only use under dry weather conditions, as the micro:bit and the battery or LiPo pack are sensitive to humidity. You may want encapsulate them, e.g. in a clear plastic container.”

Link