issue printing ints from an array #2485
Unanswered
DrJaymz
asked this question in
Q&A - Sprites
Replies: 1 comment 2 replies
-
I don't provide support for M5 variants of the library. If you post a simple complete sketch that demonstrates the problem using this master library then you may get help. I don't have access to any suitable hardware to test your sketch but maybe a library user can help. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I've been using the library on a bunch of different hardware but I am having a silly issue with I'm 100% certain is caused by me.
I'm drawing a gauge into a sprite like this (don't need to go through that but note the for loop):
and calling it like this:
You can see I'm using the M5 core2 but I see its subclassed the TFT library so I'm treating it as the same thing.
My intention is to iterate through the array of labels and when I get a match I print the label.
debug output would be:
10:10 30:30 50:50 70:70 90:90 100:100
This shows that I am not iterrating off the end and that I can unpack the labels I put in.
but both sprite.print(cstr) or sprite.print(labels[i]) cause it to crash. with 'loadprohibited'.
I thought maybe I had been getting confused with pointer and actual data which is why I added the debug to check that it was the data I was expecting and the debug shows what I expect.
I even used sprite.printf() so its exactly the same, but it still falls over. So if printf works for serial port why does it crash for the sprite?
Beta Was this translation helpful? Give feedback.
All reactions