The idea for this project came from a tweet by David Whale (@whaleygeek) showing a font he had come up with for the micro:bit that managed to squeeze 2 digits onto the 5x5 LED display. I took the initial clock code he had written and added functionality to read a Real Time Clock module connected via the I2C port together with some other bits.
The time display is spread over 3 micro:bits (2 if you don't want seconds). These communicate using the radio function in MicroPython. You can also have a single micro:bit with a scrolling display. There is no limit to the number of slave micro:bits, but do only connect the RTC to a single micro:bit.
By making some very minor changes to the code you can display the time 12 or 24 hour notation - the bit you need to change are clearly commented in the code from s/w revision 7 on-wards.
The clever bit (well I think it it is!) is that the micro:bits all run exactly the same code. You configure the display to hours / minutes / seconds or scrolling by connecting the P0-3 lines high. The software automatically identifies if it has the RTC connected to it and if so makes itself the master, synchronizing the other micro:bits every minute.
Part 2The whole thing is written in micro-python, programmed in MU running on a Raspberry Pi. The code listing is commented so you can sort out which bit does what. If you want to change to code, it is worth noting that it basically maxes out the available micro:bit memory as it stands.
Hardware - it is really up to you. I have used small 'maker' interface boards I got made to allow me to mount the micro:bits vertically on a bit 0.1" matrix board, but you can easily use one of the commercially available breakout boards. The RTC is a DS3231 RTC module. The only other bit I added was a simple 3.3 volt PSU using a 78L33 and microUSB adapter board.
If you don't want to build the power supply, you can simply power one of the micro:bits from its battery or micro:USB connection and it will feed the others and RTC.
You can find other stuff on the micro:bit, Raspberry Pi and Arduino on my blog: https://meanderingpi.wordpress.com/
Comments