Time & Date Blocks

I shared this on other forums, but not here. A few months ago I made a set of Time & Date blocks, which are now an approved extension. I’d appreciate any feedback.

They can be used for:

You can find them by searching for “microbit-pxt-timeanddate” in the extensions.

Documentation is here: https://makecode.microbit.org/pkg/bsiever/microbit-pxt-timeanddate

Oh, a bonus…here’s an example of a binary clock using them: https://makecode.microbit.org/_MJqeqei2aFjJ .
The time needs to be set first. Hold “A” to advance the hour, then hold “B” for a bit to move on to minute. Again hold “A” to advance the minute, then “B” to move on. Then the clock will be shown. The first two columns represent the hour, then a column that blinks “:” (off 1 second then on 1 second), then two columns for the minute. The least significant bit is the bottom row of each column.

4 Likes

I absolutely love this extension and have used it a ton in my projects, thanks for adding it! The only thing I could think to add is support for a external rtc board?

Thanks for the feedback! I’m glad people are finding it useful and I’d love to hear the kinds of things it’s being used for.

There are several existing extensions that support hardware RTCs (DS3231, RTC1307, etc.) and there are some products that include an RTC and the RTC blocks can sometimes be used without the other components of the extension. This set of blocks was meant specifically for a “no hardware added” approach to RTC. It works well on the v1 micro:bits, but suffers a bit from clock drift on the v2s. I don’t plan to add hardware RTC support to this extension because I think it would be contrary to the “no hardware added” intention.

I’m open to creating another extension that supports an RTC though. I was looking into this for another project (sensor data logging). I have pretty limited time this part of the year and may not make much progress for some time, but let me know if there’s a specific RTC that could benefit from support.

By the way, here’s a summary of my extensions so far: https://siever.info/home/microbit-makecode-extensions/

Bill

1 Like