PDA

View Full Version : TM1628 sample code anyone?



CuriousOne
- 23rd July 2021, 06:08
Hello.
There are thousands of interesting LED modules sold with these controllers.
like this one for example.
https://item.taobao.com/item.htm?id=643277470788

Arduino do has library, but we? :)

CuriousOne
- 15th August 2021, 06:29
I took the code available here: TM1638 LED Display Driver/Controller (picbasic.co.uk) (http://www.picbasic.co.uk/forum/showthread.php?t=24154) , for TM1638, and modded it a bit (added support for 8 and 9), so now it works for that TM1628 module, link for which I've posted, too. All what it does, counts from 0 to 99, but looking at code, you can guess how to use it on your demand.

Use configs and other variables from the post above (or make your own) and replace the MAIN part in above code with this:



FOR I=0 TO 99
LOW STB
LOOKUP I DIG 1,[$3F,$06,$5B,$4F,$66,$6D,$7D,$07,$7f,$6F],J
SHIFTOUT SDA, SCK, 0, [$C0+0,J]
HIGH STB
LOW STB
LOOKUP I DIG 0,[$3F,$06,$5B,$4F,$66,$6D,$7D,$07,$7f,$6F],j
SHIFTOUT SDA, SCK, 0, [$C0+2,J]
HIGH STB
PAUSE 100
NEXT


If anyone can suggest, how can I use lookup only once (if possible), that would be great.