Tags:
create new tag
view all tags

The LED matrix shield

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.

ledMatrix.png

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

Comments

Topic attachments
I Attachment History Action Size Date Who Comment
PNGpng ledMatrix.png r1 manage 138.2 K 2019-03-22 - 14:34 UliRaich  
Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r2 - 2019-05-17 - UliRaich
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback