LED Matrix 8x8 based on ht16K33 I2C
Moderator: Benj
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: LED Matrix 8x8 based on ht16K33 I2C
I've pushed another update to the component which hopefully fixes the 8x8 module so the hardware should match the others and the simulation.
As for text on the 8x16 backpack I'm going to leave this for now if that's ok as there will likely be a fair bit of code required to get this to function. If you ever need it in the future then give me a shout and I can look again.
As for text on the 8x16 backpack I'm going to leave this for now if that's ok as there will likely be a fair bit of code required to get this to function. If you ever need it in the future then give me a shout and I can look again.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: LED Matrix 8x8 based on ht16K33 I2C
I know, that caused me a bit of head scratching at first.Benj wrote:Oh wow yes I see it now, That is crazy I wonder why they laid it out like that!
Thanks Ben,Benj wrote:As for text on the 8x16 backpack I'm going to leave this for now if that's ok as there will likely be a fair bit of code required to get this to function. If you ever need it in the future then give me a shout and I can look again.
I was going to surprise some one with a message of it scrolling long ways as they have a few 8x16 backpack .
But don't want to take too much of your valuable time so it will be fine.
I do have suggestion though for when you revisit component. What about change orientation which just changes direction from right - left to up - down
I'm afraid its not working.Benj wrote:I've pushed another update to the component which hopefully fixes the 8x8 module so the hardware should match the others and the simulation.
The LED's scroll but pattern looks like chars been cut in half and stitched back with alignment out.
Martin
Martin
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: LED Matrix 8x8 based on ht16K33 I2C
Hi Martin,
Here is the code
and here is my working out to get the bits 1-8 back into the correct position.
A standard device has 1-8 in the correct position and this is known to work.
The next set of data shows how unmodified data would appear on the 8x8 display.
Shifting right by 1 moves the bits down so that 8-2 are now in the right place.
Finally Oring 0x80 if bit 0 was set should add in the 1 in the right place.
Yes this should be possible once I add the extra code, it's certainly possible but means manipulating inner byte rather than moving bytes around. I'll have a quick go if I get chance later this week.I do have suggestion though for when you revisit component. What about change orientation which just changes direction from right - left to up - down
I've been over this again and again, please can you double check that your addressing is correct.I'm afraid its not working.
The LED's scroll but pattern looks like chars been cut in half and stitched back with alignment out.
Here is the code
and here is my working out to get the bits 1-8 back into the correct position.
A standard device has 1-8 in the correct position and this is known to work.
The next set of data shows how unmodified data would appear on the 8x8 display.
Shifting right by 1 moves the bits down so that 8-2 are now in the right place.
Finally Oring 0x80 if bit 0 was set should add in the 1 in the right place.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: LED Matrix 8x8 based on ht16K33 I2C
Hi Ben,
As a sanity check, compiled flowchart: Got the following results: : I Don't understand as the image of flowchart you posted looks spot on to me.
Displaying the letter A: Text here from someone else also mentions about the complication:
As a sanity check, compiled flowchart: Got the following results: : I Don't understand as the image of flowchart you posted looks spot on to me.
Displaying the letter A: Text here from someone else also mentions about the complication:
I’m setting all rows to the value 0xaa (i.e. binary 10101010). However, there is a complication – the bits are actually offset against the LEDs, so writing 0x01 actually illuminates the 2nd LED of each row. So you actually need to do the following (taken from the source code of the library):
bitnum0to7 = (LED + 7) mod 8
So to set the first LED, write the hex pattern 0x80. For the second LED, use 0x01; the third 0x02; fourth 0x04 and so on up to the last LED on the row being 0x40. I assume this is quirk of the wiring of the LED matrix to the driver pins of the HT16K33.
- Attachments
-
- HT16K33 Test.fcfx
- (21.95 KiB) Downloaded 268 times
Martin
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: LED Matrix 8x8 based on ht16K33 I2C
Hi Martin,
Thanks for the images, they help a lot. It looks like I am doing the right thing but it seems to be happening multiple times so I maybe need to be careful about when I apply the manipulation. I've had another play and hopefully we are closer now!
I had a eureka moment last night about how to do vertical text without going round the houses and this is now in and hopefully working, seems fine in the sim so I am hopeful.
I've just pushed a new update so let me know how you get on.
Thanks for the images, they help a lot. It looks like I am doing the right thing but it seems to be happening multiple times so I maybe need to be careful about when I apply the manipulation. I've had another play and hopefully we are closer now!
I had a eureka moment last night about how to do vertical text without going round the houses and this is now in and hopefully working, seems fine in the sim so I am hopeful.
I've just pushed a new update so let me know how you get on.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: LED Matrix 8x8 based on ht16K33 I2C
Hi Ben.
Re 8x8... Scrolling with orientation on 0 is now perfect!
Scrolling chars with orientation on 1 is not working.
Just using again as an example:
8x8 does not scroll at all. Just a static 3 LED's lit
The other two do scroll, just chars are wrong.
Orientation 0 or 1 within DisplayString component is a great idea!
Martin
Re 8x8... Scrolling with orientation on 0 is now perfect!
Scrolling chars with orientation on 1 is not working.
Just using
Code: Select all
A
The other two do scroll, just chars are wrong.
Orientation 0 or 1 within DisplayString component is a great idea!
Martin
Martin
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: LED Matrix 8x8 based on ht16K33 I2C
Thanks Martin,
Hopefully should be fixed now.
Hopefully should be fixed now.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: LED Matrix 8x8 based on ht16K33 I2C
Hi Ben thank you.
I don't know how you do it without testing on hardware first!
Very clever!
It's so near!
Results:
8x16 Backpack. Works with both orientations.
16x8 Featherwing. Works with both orientations.
8x8 works with orientation 0 but not with orientation 1 (only bottom row are changing, looks like random grouping rather than scrolling.
However can get it to work on orientation 1 if using code from 8x16 Backpack.
Sorry for another suggestion so late in the day but not a vital function, just useful.
Is there way of allowing us to add a few custom patterns.
E.g if we want to add a smiling face.
Perhaps via a kind of LUT?
I don't know how you do it without testing on hardware first!
Very clever!
It's so near!
Results:
8x16 Backpack. Works with both orientations.
16x8 Featherwing. Works with both orientations.
8x8 works with orientation 0 but not with orientation 1 (only bottom row are changing, looks like random grouping rather than scrolling.
However can get it to work on orientation 1 if using code from 8x16 Backpack.
Sorry for another suggestion so late in the day but not a vital function, just useful.
Is there way of allowing us to add a few custom patterns.
E.g if we want to add a smiling face.
Perhaps via a kind of LUT?
Martin
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: LED Matrix 8x8 based on ht16K33 I2C
Hi Martin
Brilliant nearly there then
I could integrate the bitmap drawer components so you can use a monochrome bitmap. Would that do what you need?
Brilliant nearly there then
I could integrate the bitmap drawer components so you can use a monochrome bitmap. Would that do what you need?
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: LED Matrix 8x8 based on ht16K33 I2C
Yes, you are definitely nearly there!
If easy to use then that will be fantastic!
Thanks for all your hard work you have clearly put in to this!
Sounds great to me.Benj wrote:I could integrate the bitmap drawer components so you can use a monochrome bitmap. Would that do what you need?
If easy to use then that will be fantastic!
Thanks for all your hard work you have clearly put in to this!
Martin
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: LED Matrix 8x8 based on ht16K33 I2C
Hi Martin,
Right I've updated the component again, fingers crossed this fixes all the bugs with the 8x8 module.
I've also added the functionality to the Bitmap drawer components so you can point them at the HT16K33 component. Any problems here then please let me know but I think it should all be ok. I've tested the sim works but that's about it.
Here's an example.
Right I've updated the component again, fingers crossed this fixes all the bugs with the 8x8 module.
I've also added the functionality to the Bitmap drawer components so you can point them at the HT16K33 component. Any problems here then please let me know but I think it should all be ok. I've tested the sim works but that's about it.
Here's an example.
Just doing my job Also you do a lot for our users so it's nice to give you something back in return.Thanks for all your hard work you have clearly put in to this!
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: LED Matrix 8x8 based on ht16K33 I2C
On Monday I'll add bounds checking to the led matrix component so the bitmap can be safely drawn partially off screen for sliding animations. I don't think it's in there at the moment!
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: LED Matrix 8x8 based on ht16K33 I2C
Thanks Ben,Benj wrote:so it's nice to give you something back in return.
Do love the Monochrome bitmap idea as there is apps that creating for you for free!
Re Bitmap and 8x16 Backpack.
I can't get the image to orientate across long ways.
I enabled all 128 pixels and got the following with: Although change flowchart to featherwing and keep hardware as 16x8 backpack then all leds except row 4 light.
Harware/software Featherwing.
All LED's Light.
With 123 as a bitmap: Hardware matches simulator perfectly!
All is correct so long as orientation is on 1 not 0. I would of thought it would be the other-way around.
It does not matter so long as its known. Just thought I would point it out.
8x8 Backpack: like the feaherwing working with mono bit map. Same information regarding orientation applies.
Re display string. Still working with orientation 0.
With orientation 1 for the character
Code: Select all
A
Thank you.
Martin
Martin
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: LED Matrix 8x8 based on ht16K33 I2C
Hi Ben,
Sorry please ignore:
Martin
Sorry please ignore:
It was a dry joint.medelec35 wrote:Although change flowchart to featherwing and keep hardware as 16x8 backpack then all leds except row 4 light.
Martin
Martin
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: LED Matrix 8x8 based on ht16K33 I2C
Hello,
It looks like the orientation parameter in the Bitmap and FAT Bitmap components was only implemented for colour GLCDs. I've now rolled this out to everything which should hopefully fix the problem with the 8x16 Backpack. I can't see anything wrong with my maths for the 8x16 so I'm hoping it's the bitmap drawer components at fault.I can't get the image to orientate across long ways.
I was going to invert the orientation but I've left this as was for now just to avoid adding more bugs .All is correct so long as orientation is on 1 not 0. I would of thought it would be the other-way around.
It does not matter so long as its known. Just thought I would point it out.
Hmm not too sure on this one, I may have fixed it now but have a go and let me know.8x8 Backpack: like the feaherwing working with mono bit map. Same information regarding orientation applies.
Re display string. Still working with orientation 0.
With orientation 1 for the character
Bounds checking has now been implemented so hopefully the component is a bit more bulletproof and bitmaps can be drawn partially off screen without nasty things happening such as RAM memory corruption.On Monday I'll add bounds checking to the led matrix component so the bitmap can be safely drawn partially off screen for sliding animations.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: LED Matrix 8x8 based on ht16K33 I2C
Hi Ben,
here are the results using Bitmap: The hardware matches Flowcode simulation using bitmap images.
If you're ok with setting flip to 2 to make it work, then you have cracked it.
Good job!
The only issue is with DisplayString function on 8x8 backpack and only with orientation 1.
Working OK with orientation 0.
I have sent you a short video via email of sending in orientation 1
Martin
here are the results using Bitmap: The hardware matches Flowcode simulation using bitmap images.
If you're ok with setting flip to 2 to make it work, then you have cracked it.
Good job!
The only issue is with DisplayString function on 8x8 backpack and only with orientation 1.
Working OK with orientation 0.
I have sent you a short video via email of sending
Code: Select all
123
Martin
Martin
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: LED Matrix 8x8 based on ht16K33 I2C
Thanks for the vid Martin.
I've had another go for you and pushed the update, fingers crossed.The only issue is with DisplayString function on 8x8 backpack and only with orientation 1.
The GLCD components have 0 being the top row but it is the bottom row in the LED array component. I was going to try and auto flip this but couldn't spot a nice place to do this. It might come to me but for now I'm going to leave as isThe hardware matches Flowcode simulation using bitmap images.
If you're ok with setting flip to 2 to make it work, then you have cracked it.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: LED Matrix 8x8 based on ht16K33 I2C
Hi Ben, thanks for the update.
Re: 8x8 Backpack
Unfortunately with orientation on 0 using DisplayString component, we are back to: .
The good news is orientation 1 works perfectly!
so this is the closest to completion so far.
I just had a look at the help for the component and spotted: The other zip files forfor example does not show such a warning.
I believe the warning will put people off from downloading example?
Martin
Re: 8x8 Backpack
Unfortunately with orientation on 0 using DisplayString component, we are back to: .
The good news is orientation 1 works perfectly!
so this is the closest to completion so far.
Thanks Ben not an issue at all!Benj wrote: I was going to try and auto flip this but couldn't spot a nice place to do this. It might come to me but for now I'm going to leave as is
I just had a look at the help for the component and spotted: The other zip files for
Code: Select all
Component: Bitmap Drawer ROM
I believe the warning will put people off from downloading example?
Martin
Martin
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: LED Matrix 8x8 based on ht16K33 I2C
Hi Ben,
Would it be possible to add the this component to the existing collection please?
If so, I have made it a lot easier by learning how it works and produced a fully function flowchart.
The functions are:
Increment from 0000 to 9999 to 0000 etc.
When count is = 0020 then enable colon e.g. 00:20, 00:21 etc
When count >= 50 then add the DP to the far right e.g. 00:50. , 00:51. etc
When count is = 100 Clear the colon e.g 0100.
All proven on hardware.
Would it be possible to add the this component to the existing collection please?
If so, I have made it a lot easier by learning how it works and produced a fully function flowchart.
The functions are:
Increment from 0000 to 9999 to 0000 etc.
When count is = 0020 then enable colon e.g. 00:20, 00:21 etc
When count >= 50 then add the DP to the far right e.g. 00:50. , 00:51. etc
When count is = 100 Clear the colon e.g 0100.
All proven on hardware.
- Attachments
-
- LED7SegHT16k33Backpack.fcfx
- (26.73 KiB) Downloaded 161 times
Martin