This shield provides a 8x8 led matrix where each led can be individually be switched on and off and its intensity be controlled. The program uses the mled class which implements the driver for the TM1640 chip by Titan micro. As the README in the mled description says, the TM1640 implements a weird protocol which reminds both of I2C and SPI but is not compatible with either. Fortunately for us somebody else figured out how to control the chip and we simply use his driver.
A few example programs are given with the driver and these you can find here:
https://github.com/uraich/MicroPython_IoTDemos/tree/master/drivers/ledArray
I added a new class matrix on top of mled which implements a method setLevel(value) taking a value (0..64) specifying how many leds should be switched on, starting from the bottom left led. This could be used to show the fill state of a tank: full: most leds on, empty: most leds off.
The cayenne version of the program
https://github.com/uraich/MicroPython_IoTDemos/blob/master/cayenne/ledArray/cayenneLedMatrix.py
subscribes to a Cayenne channel to get the value for the setLevel value. Try to run it with a slider providing values 0..64.
https://github.com/uraich/MicroPython_IoTDemos/blob/master/cayenne/ledArray/cayenneLedMatrix.py
-- Uli Raich - 2019-03-22