Close

Getting Light Characteristics

A project log for Sailing the 7 Seas -- nautical blinkenlights

Nautically correct blinkenlights that flash just like the real lighthouses and buoys; on a colourful nautical map thanks to JLCPCBs new PCBs

dirk-willem-van-gulikDirk-WIllem van Gulik 12/29/2023 at 21:510 Comments

So we have a working set of blinkenlights. The next challenge is translating the map sequences to the right flashing lights. And get this stuff compact enough to fit in the few 100 bytes we have in a STM8 CPU.

There are some libraries in Pascal, Javascript and Python that allegedly convert these sequences. The first attempt with python its light-character seems to output sensible code.

Running various sets of lights show that most of the generated sequences have a lowest common `shortest change time' somewhere in the 0.2 to 1 second; and that the most complex sequences are early longer than 20 steps or 50 seconds. 

This means that writing these out as sequences of bits is not ideal; but that some sort of playlist would likely fit in a few bytes per steps if we accept that we need to store 2 or so values per light. With the above - these appears to still fit in 8bits. So that is doable for the 30-50 lights typically expected.

Discussions