Since many people won't get to see Mark Estes demos running,

(Marc MERLIN) #1

Since many people won’t get to see @Mark_Estes demos running, I modified his code to allow a selection of best of patterns, and loop through just those. This allowed me to take a 5mn video instead of a 30mn+ one :slight_smile:

New code with bestof support is posted here:

Again, great job Mark.

(Yves BAZIN) #2

Impressive set of animations

(Mark Estes) #3

hey, thanks. wow.

(Marc MERLIN) #4

I don’t know why, Mark’s reply was marked as spam. I’ll copy it here:
Mark Estes
i have a few of these in short videos shared

and easy to find - son of more audio patterns
and here:

(Darren Hedlund) #5

Nice!!! amazing work…

(chad steinglass) #6

hey @Marc_MERLIN and @Mark_Estes - finally getting a chance to look at some programming since I packed and shipped all my costume stuff off yesterday.

First time I’m playing with the LEDMatrix library, and just from the example sketch I can tell its going to be powerful for pattern design, and already came up with a hacky but easy way to map from a defined matrix to my irregularly shaped stuff

I can’t get the code in your port of Mark’s patterns to run though - compiles just fine, but when I run it I’m getting divide by zero errors. Might just be an esp32 problem, but I’m wondering if you ran into that at all?

(Marc MERLIN) #7

@chad_steinglass ESP32 and ESP8266 should give you a traceback that you can put into a decoder you need to install in the arduino java GUI. that should tell you were the divide by 0 is happening.
Without that, kind of hard to help :wink:

(Marc MERLIN) #8

@chad_steinglass also, if you look at

you can select which demos run. If one of them is doing division by 0, you can select other ones.
That is unless you’re getting division by 0 everywhere before anything even runs.
Then you can also use printf debugging :slight_smile:

(chad steinglass) #9

@Marc_MERLIN thanks - yeah - I was getting a divide by zero before anything even displayed. I’m copying the patterns over one by one into an example sketch that runs, but I’m like 3 for 10 so far on patterns that don’t cause an error and reboot.

I think its possible that the way the esp32 handles divide by zero is different than the teensy or other arduino boards, so perhaps a calculation that resolves to zero on the teensy is causing a reboot on the esp32. What chip set were you using when you ported over MArk’s code?

Not too worried about it - right now I’m in learning mode… if I figure it out, great, but if not I’m not going to stress about it too much. I’m mainly playing around to se if I can understand the matrix libraries more than anything else.


(Marc MERLIN) #10

@chad_steinglass I’m running on ESP8266, it’s almost the same. You must be getting a division by 0 in the init part of the code. Again, please install it will tell you where the division is happening, no more guessing :slight_smile:
Then again, looking at the code, there is only one place that seems it could divide by 0:
This line maybe?

(Marc MERLIN) #11

As for printf debugging, if you can’t get the exception debugging to work, is to sprinkle printfs in the code and see how many print before you get the crash. Then you narrow it down to the piece of code that is doing it.
But honestly, this is what you’d do on a teensy without tracebacks like the ESP32. On ESP32, you shouldn’t need that barbaric method.

(chad steinglass) #12

ooh interesting - didn’t know about the exception decoder - I’ll take a look

and as a test I just compiled for a small matrix and ran of an arduino pro (had to change some of the floats to ints to stay under memory constraints, which broke one or two patterns but it was just a test) and the patterns that were causing a crash on the esp32 worked just fine on the arduino micro


(chad steinglass) #13

thanks again Marc - I’m definitely weaker with this (programming and debugging) aspect than I am with the digital electronics side. but always happy to be learning!

(Marc MERLIN) #14

@chad_steinglass eheh, we all get to learn something in the process. Last time I did C++ was in school some 20+ years ago :slight_smile:
Thankfully I at least learned on 8/16bit machines with assembly code where we knew what bits and bytes were and how to debug assembly the hard way. Arduino is easy in comparison :slight_smile: Too many kids those days are totally lacking the concept of what’s in the computer underneath all the layers that their high level code runs on :slight_smile:
The strack trace and exception decoder is actually the best debugging feature of the ESP chips. Teensy is quite sad in comparison unless you cut some traces on the board and hook up a professional debugger on it (not supported by the normal teensy hardware sadly)

(chad steinglass) #15

hmmm looks like the errors I’m getting are from within the LEDMatrix library… assuming I’m reading this correctly

Decoding stack results
0x400df621: cLEDMatrixBase::DrawLine(short, short, short, short, CRGB) at C:\Users\stein\Documents\Arduino\libraries\LEDMatrix\LEDMatrix.cpp line 155
0x400df71b: cLEDMatrixBase::DrawRectangle(short, short, short, short, CRGB) at C:\Users\stein\Documents\Arduino\libraries\LEDMatrix\LEDMatrix.cpp line 188
0x400d745e: boxer() at C:\Users\stein\Documents\Arduino\Mark_Estes_Table/Mark_Estes_Table.ino line 3237
0x400ddb24: runpattern() at C:\Users\stein\Documents\Arduino\Mark_Estes_Table/Mark_Estes_Table.ino line 823
0x400df195: loop() at C:\Users\stein\Documents\Arduino\Mark_Estes_Table/Mark_Estes_Table.ino line 231
0x400f4386: loopTask(void*) at C:\Users\stein\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.0\cores\esp32\main.cpp line 17

tracing back to DrawLine and DrawRectangle

is that what it looks like to you?

(Marc MERLIN) #16

@chad_steinglass sorry, can’t look at it until tomorrow, but you should likely sprinkle a bunch of printfs and narrow down where this happens.
I’m assuming you don’t have a problem with your matrix/array definition which would cause a crash.
Oh, I think this bug:

(Marc MERLIN) #17

@Marc_MERLIN if this is your bug, please chime in on both that github and the main source that they should really fix this stupid bug, I totally forgot about it. And by fix the bug I mean merge my patch already :slight_smile:

(chad steinglass) #18

Thanks Marc - that’s almost certainly what I’m running in to. makes sense at least given the errors I’m getting. I’ll add your edits into my copy of the library, and if that does it I’ll add a comment on github as another voice asking for your edits to be added

(chad steinglass) #19

@Marc_MERLIN WINNER. after updating the LEDMatrix library with your fixes for drawing a single point line, it works flawlessly :slight_smile:

(Marc MERLIN) #20

And you’re seeing this because of your matrix size that is causing a single pixel line on an object fill and not doing it for the guy who wrote the library because his matrix size doesn’t cause that condition.
Disappointing they still haven’t merged the fix, although it looks like the library is abandonned by both Aaron and Vikinggod :frowning: