Adafruit's 32x32 RGB LED matrix panel #457
Replies: 21 comments
-
Posted at 2014-04-02 by DrAzzy Isn't that just a 32x32 array of WS2812's, just like the RGB123 ones? (only with different spacing and pricing) Try talking to them like they were an RGB123 array - note that you wont be able to light up very many of the LEDs at full brightness if you're powering it off of USB; you'll need a real power supply. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-04-03 by @gfwilliams You mean these kinds of things? http://learn.adafruit.com/32x16-32x32-rgb-led-matrix/overview If it is those, they don't have any built-in controller so you're going to have to write code to scan each pixel out individually. With a bit of work you might be able to get it working, but personally I don't think the result is going to be that great (Espruino isn't designed for bit-bashing data out, so the scan rate won't be that fast and you're unlikely to be able to get more than 1 bit per channel = 7 colours). They also seem to be 'end of life' units - I don't think they're being made any more? If you haven't already bought one of Adafruit's modules, I'd strongly recommend that you use RGB123 or one of the chinese versions - you'll get full 24 bit colour and they're much easier to wire up and use. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-04-03 by user6837 Yes, those are the ones I meant, they mentioned on the page that with a 16 MHz Arduino are able to pull 12-bit color, so I think it is doable, I got one, the size was the reason to get it, I wanted something at least 32x32 so I'll try to make it work. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-04-03 by @gfwilliams The difference is that the 16Mhz Arduino was programmed using inline assembler (if you look at the library source) rather than in JavaScript :) Having said that, you could:
|
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-04-03 by DrAzzy Wow. I'm stunned that they're not WS2812's, which would be a cinch to control... At that price, i'd really expect them to be. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-04-04 by JumJum I would like to play around a little bit with this. RGB123 is too expensive having in mind to play only. What is the "chinese version" of that ? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-04-04 by @gfwilliams The MAX7219 is really neat and easy to chain. There's a thread on it somewhere (although it's gone a bit quiet now). |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-04-06 by mattbrailsford @jumjum I'm playing around with the Adafruit bi-color 8x8 matrix which is pretty cool. About £16 here in the UK, so not overly expensive. I've written a library for it for the Espruino on my other thread, so should be pretty easy to get going. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-04-11 by user6837 Using the attached as a test image with the following code, I ve got times of 1.43 seconds to fill a screen, however disabling the pin outputs the time falls down to 0.96 seconds, so I am sure more can be done to be optimized probably using assembler as the logic is actually quite simple, I expect this to be useful to someone with more skills that can improve it or changed to make it usable.
Attachments: |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-04-11 by @gfwilliams Thanks! So does the LED matrix that you have actually hold its contents - or does it have to be scanned out repeatedly? You could do something like this to write all 3 colours and the clock in one instruction (instead of your
It should be a lot faster as you're effectively getting Espruino to iterate over the array. I don't have a display to test with, but it should work (although the offset/length for Uint32Array could be wrong). The craziness with multiply+shift is because I'm trying to extract 3 bit colour from the 24 bit image. I guess ideally you'd use the built-in graphics library which will do 4 bit colour, so you could use 3 bits of those 4 bits and make your life a lot easier. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-04-11 by user6837 It would hold the last bit you send, it doesn't have internal pwm so basically you do the pwm by sending the screen over and over, so the source comes with 256 tones for each color, but on the first lines I make the conversion to the amount of tones I would use, in this case I chose 2 to get the times I posted above. Thnx for your response but I do not really understood the code you share wonder if you could explain a little more what it does, I am just beginning with Espruino and Javascript. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-04-11 by @gfwilliams Ahh, thanks... I think getting multiple tones (or even something non-flickery) is going to be properly hard work without using assembler I'm afraid :( In the code I posted:
Anyway, that and some other tweaks should make it a lot faster, but I think you're still going to have quite a bit of trouble with it... |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-04-14 by user6837 Hi Gordon, thanks, I 've been really trying to understand the logic on the bitwise operations so I could adjust something similar to get alike results in terms of time, but I don't really get it, according to my understanding the (*) and the shift both operations are equivalent to divide within 127 so why not just divide, perhaps I don't really get it at all, also on the digitalWrite for multiple pins on which order gets executed, from right to left? I really appreciate your feedback. Thnx |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-04-14 by @gfwilliams digitalWrite executes right to left (least-significant bit first) You're right about the /127, but it's not quite 127, it's There was a discussion elsewhere on here, but if you break the multiply down, you get:
If you assume that the 3 bits you want are as follows:
Then when you do that multiply you get:
And then when you shift it down and & with 7 you get:
Anyway, it's a bit of a nasty hack. Precalculating so as to avoid having to do that would be much better :) |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-04-16 by user6837 Hi, I am using this:
The data from the file comes as
The issue I am facing is that it works as long as I have as blue >128 other wise something funny happens, I don't really know what, here is the full code and some sample files.
Attachments: |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-04-16 by user6837 It seems that what is empty on the left is filled with Ones, and consider the number negative, how do I avoid this? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-04-17 by @gfwilliams Try replacing:
with:
The The issue is that when the top bit of a number gets set, signed shift shifts in extra 1s as you shift right (so Having said that, there appears to be a bug in Espruino that causes Uint32Array to return negative numbers (which is why this is a problem). I've had it down as something to fix - however it works when compiled on the PC, but not when running on the device! |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-04-17 by user6837 Same result. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-04-22 by moka Just unrelated tip, but will reduce size of emptiness in your code :)
|
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-04-22 by user6837 Hi Moka, Yes, I had like that, this was just a desperate attempt to make it faster , right now, I am able to get 1 screen every 0.59 seconds which is barely usable. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-04-23 by @gfwilliams Seems to work for me?
If you're serious about getting the scanning speed up, I'd try and precalculate a Uint8Array of bytes where the 4th bit is 1, and the 1st, 2nd and 3rd are R,G and B. Then you can do something like:
(new versions of Espruino allow you to use forEach directly, rather than the whole Having said that, for the 1024 bytes (32x32) it still seems to take 247ms (and that's without the latching), which is too slow for you really. To get the speed up you might still be looking at writing some inline assembler. A quick test shows that you can get down to around 30ms:
although that's not doing anything in the assembler code itself - you'd have to write some code to set the relevant pins to the right values. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-04-02 by user6837
Hi,
Has anyone has attempted to use one of this with Espruino, they have libraries built for arduino so I think it should be possible to do it with an Espruino, as an output for projects or to show bmp and animated GIFs, please let me know if anyone has some advance on this.
Cheers
Arturo
Beta Was this translation helpful? Give feedback.
All reactions