Adafruit 16x32 RGB LED Matrix

@ScruffR, Hey Just an update - little steps have been made ( and it took ages) :smile:
Spark dev Installed (Tick)
simple flash LED code copied into a new .ino TAB (Tick)
Compile .ino file in the cloud, BIN created, core updated (Tick)
LED flashing (Tick)

I have come to learn that (in a small way) happiness is a flashing LED. Is that wrong??? :smile:

OK so I guess that to add .cpp files and .h files, I would put them into different tabs in the spark Dev screen and then compile away?

:smile:

Can you enlarge on -

At the moment it’s just a bit of a pain that you have to put all the required files for compilation into one directory and have to alter the #include statements accordingly.

Thanks

4 Likes

Hi @Julian, good to hear you’re getting things working :+1:

For building a larger project you’d create one folder into which you’d copy all required .cpp, .h and .ino files (but don’t put other files into it).
Then you’d open the “File” menu and in there find “Open Folder …” and navigate to your project folder and select it.
Then all the files in there will be displayed in a side-bar and you can build away :wink:

The thing with the includes is, that libs usually contain something like #include "../somelib/somelib.h" which you'd need to change into#include “somelib.h”.
I usually put the original version and the altered into something like this

#define SPARKDEV

#if defined(SPARKDEV)
  #include "somelib.h"
#else
  #include "../somelib/somelib.h"
#endif

Hope this helps

1 Like

@ScruffR, @Peekay123 Thank you for your explanation. I think I understand. To test that I am going to try a neopixel library example first. The spark dev environment seems like it could be a half way between CLI and IDE.

When you add an #include statement into your code, does it then expose the abilities of the libryr you are envoking or do you have to add the library yourself into another tab?

So for example if I call #include neopixel.h do I then have to add a tab, call it neopixel.h and add some code, from somewhere? Or is it added just by the #include statement?

Cheers,

If you are talking about Spark Dev you just do as written in my post above - especially this

No less no more. As for libraries it means ALL .h/.cpp files which belong to the lib.

For terminology:
Instead of calling it "to add a tab" you might rather use "add a file to the project (folder)", this might make clearer what actually needs to be done.
You can add a file from inside Spark Dev (as File ... New File) or just by copying it into the folder - no matter how.

2 Likes

Thank you very much.

:smile:

@ScruffR, So I have it set out in a project folder with files (tabs) inside it. I have changed the #include statements to show no path, just neopixel.h for example.

I am getting an error saying the app code is invalid. I think I need to put in the application.h file as it is referenced in some of the other code.

Where can I get the application.h code from to add to a new file in my folder?

:smile: Loads of fun :smile:

The application.h is part of the Spark infrastructure and does not need to be present in the project folder.

Have you got only .h & .cpp files and exactly one .ino file in your folder? If not, make sure of it.

1 Like

OK, Big thanks required to :-

@ScruffR,
@peekay123,

and @bko & @Dave for your positive thoughts!! (it all helps!)

JUST COMPILED MY FIRST FOLDER THROUGH SPARK DEV (BIG TICK) :smile:

Thanks

4 Likes

Time for a celebratory cup of tea and a festive mice pie to build up a head of steam to get into that 16x32 matrix ( which is where we started :smile:)

2 Likes

@ScruffR, what other things are part of the spark infrastructure?

I am looking for gamma.h, SparkIntervalTimer.h and Adafruit_mfGFX.h?

In fact, is there a list of them somewhere?

:smile:

These three are libraries tha have to be added to your project folder (gamma is part of the Adafruit_mfGFX lib by @peekay123, SparkIntervalTimer is a seperate one by the same awesome guy).

Usually you’ll find an indication what other libraries will be needed in the repo of the individual libraries.
A good starting point for available libraries is the Web IDE library inventory.

@peekay123 , @ScruffR, I just wondered, with the optimised library do you think a core could run one 32x32 display or more?

Has anyone had two displays side by side and linked to give say a 16 x 64 or a 64 x 32 display? (and then scrolled text across both of them?)

As said already - one 32x32 panel with or two 32x32 without double buffering is no problem.
Or four 32x16 panels would give you a 128x16 scroll text display

(repaired broken link)

2 Likes

I saw this and thought… I wonder if…

:smile:

And this, wooooow,

Want one, need to make that!!

Given the experiance I’ve made with my two panels, the video cube should be possible with no real tweaking, since it seems to show the same picture on all six faces, so you provide one pic from the Core and this gets forwarded through to all daisy chained panels. You just need to supply enough power (5V x 2A per panel = 60W).
This at least worked for two panels that way.
The video wall is a different kettle of fish, since you need to provide a different pic for each panel, for which the Core has not enough RAM.
The Photon will allow more panels, but then speed might become an issue.
If you look at the hardware used for the video wall, you’ll find some more computational power.

@ScruffR, the key word here is “video”. Both the video cube and wall take a video feed (DVI, display port, etc) to display. Neither the Core or the Photon could do that. There is some really nice high-speed matrix panel stuff for the Teensy3 product that uses DMA for high-speed refresh. The biggest issue with the Core and possibly Photon is that none of the GPIO are mapped to a single port, making it difficult for DMA to be used. I would love to optimize the RGBMatrixPanel even more to handle more panels and higher refresh rates!

@peekay123, that’s a valid point :wink:

But what does one consider a video. Any moving picture (e.g. the Teensy demo seems to be an animated GIF) or does it have to come from a standard video feed.

If it’s animations rather than video the video-cube demos may also be possible on the Core - sure, propper video would not work.

So what would @Julian want to do with it?

And as mentioned in one of my earlier posts, I have squeezed a teeny-weeny bit of speed out of your RGBmatrixPanel lib by remapping the R1, G1, B1, R2, G2, B2 pins to the low byte of GPIOA.
I have not timed it yet, tho’.
And I haven’t gone the ASM route yet either.

@ScruffR, video is video dude! I think you are talking about animation. Nonetheless your point is valid. BTW, I posted the optimized RGB pin library last week. I find that it add 30-50% improvement in frame rate!

What I would love to see is FastLed for the Core/Photon where you could do some serious animation on “smart” LEDs like neopixels. I posted a message on the authors github to see if the Spark Community could help move the port along. :smile:

I’d like to see that, too.

And yes, I was a bit flimsy in using the term “video” - I repent in sackcloth and ashes :wink:


And yes, I’ve built ontop of your lib from last week and think to have squeezed out a few CPU cycles per pixel again.

1 Like