Building And Controlling 19 LEDs & Five Buttons From Five Outputs

Numbers are hard enough in English, but [Sadale] decided to take things a step further by building a calculator that works in Toki Pona. The result is Ilo Nanpa, an awesome hardware calculator that works in this synthetic minimal language. This is a bit harder than you might think, because Toki Pona doesn’t have digits in the same way that Neo-Latin languages like English do. Instead, you combine smaller numbers to make bigger ones. One is Wan, Two is Tu, but three is Wan Tu (1+2). As you might expect, this makes dealing and representing larger numbers somewhat complicated.

Ilo Nanpa gets around this in a wonderfully elegant way, and with some impressive behind the scenes work. The calculator has 16 LEDs, nine buttons and a slider switch, but they are all controlled and read through just five IO pins on the STM8S001J3 controller that runs the device.

That’s because {Sadale] did some remarkable work with multiplexing and charlieplexing. Multiplexing is controlling more outputs than there are control inputs by using rows and columns: it is how the LED display you are probably reading this on can be controlled by just a few wires. By switching through these rows and columns at a higher speed than the eye can see, you create the illusion of a single, continuous display.

Charlieplexing takes this a step further by using multiple voltages on a single connection to further split the signal. With the clever use of voltage dividers the directional properties of LEDs and multiple voltage levels, the Ilo Nanpa runs all of the LEDs and senses all of the buttons and the slider from just five pins. That’s a remarkably neat piece of design, and it is worth spending some time looking over the excellent explanation of the process that [Sadale] wrote to see how it is done, and poring over the code for the device to see how he programmed this all into a single low powered chip. And, while you are reading, you might pick up a few words of Toki Pona. Tawa Pona!

3 thoughts on “Building And Controlling 19 LEDs & Five Buttons From Five Outputs

  1. Numbers

    Seems to me that they missed a trick by not using binary; they could have saved a word: wan, wan ala, wan wan …

    As an aside I note that

    “Words that have been simply removed from the lexicon include leko (block, stairs)” — Wikipedia

    was that derived from Lego (from Danish leg godt ‘play well’)?

Leave a Reply to jan Pite JansekeCancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.