Hi all! Earlier i have 2 panels but got some issuse with a megas limited memory so i use only 1 panel. Work fine so far.
Uploaded a sketch scroll up text. Everything fine. Changed some codes to adding more lines.
That I got problem, i added 11 lines of text, but on panel that show only 8 lines then start over.
That is 11 lines.
#define F2(progmem_ptr) (const __FlashStringHelper *)progmem_ptr
#define F3(progmem_ptr) (const __FlashStringHelper *)progmem_ptr
#define F4(progmem_ptr) (const __FlashStringHelper *)progmem_ptr
#define F5(progmem_ptr) (const __FlashStringHelper *)progmem_ptr
#define F6(progmem_ptr) (const __FlashStringHelper *)progmem_ptr
#define F7(progmem_ptr) (const __FlashStringHelper *)progmem_ptr
#define F8(progmem_ptr) (const __FlashStringHelper *)progmem_ptr
#define F9(progmem_ptr) (const __FlashStringHelper *)progmem_ptr
#define F10(progmem_ptr) (const __FlashStringHelper *)progmem_ptr
#define F11(progmem_ptr) (const __FlashStringHelper *)progmem_ptr
const char str[] PROGMEM = "$P1 Nick 1";
const char str2[] PROGMEM = "$P2 Varv 1";
const char str3[] PROGMEM = "$P3 Nick 2";
const char str4[] PROGMEM = "$P4 Varv 2";
const char str5[] PROGMEM = "$P5 Nick 3";
const char str6[] PROGMEM = "$P6 Varv 3";
const char str7[] PROGMEM = "$P7 Nick 4";
const char str8[] PROGMEM = "$P8 Varv 4"; // <- Stops at this line and start over
const char str9[] PROGMEM = "$P9 Nick 5";
const char str10[] PROGMEM = "$P10 Varv 5";
const char str11[] PROGMEM = "- - - - - - - ";
matrix.setTextColor(matrix.ColorHSV(hue, 100, 255, false));
matrix.setCursor(0, textY);
matrix.print(F2(str));
matrix.setCursor(0, textY+8);
matrix.print(F3(str2));
matrix.setCursor(0, textY+16);
matrix.print(F4(str3));
matrix.setCursor(0, textY+24);
matrix.print(F5(str4));
matrix.setCursor(0, textY+32);
matrix.print(F6(str5));
matrix.setCursor(0, textY+40);
matrix.print(F7(str6));
matrix.setCursor(0, textY+48);
matrix.print(F8(str7));
matrix.setCursor(0, textY+56);
matrix.print(F9(str8));
matrix.setCursor(0, textY+64);
matrix.print(F10(str9));
matrix.setCursor(0, textY+72);
matrix.print(F11(str10));
// Move text up (w/wrap), increase hue
if((--textY) < (-matrix.height()))
textY = matrix.height();
How many lines did you have before the change? Somewhere in the code that you did not post lies the answer to your problem.
From start it was 4 lines, i added 2 lines (6 lines), ok so far, adding 2 more (8), ok so far, adding 3 more, there is problem. I have no clue. had checked the code many times.
#define F2(progmem_ptr) (const __FlashStringHelper *)progmem_ptr
#define F3(progmem_ptr) (const __FlashStringHelper *)progmem_ptr
#define F4(progmem_ptr) (const __FlashStringHelper *)progmem_ptr
#define F5(progmem_ptr) (const __FlashStringHelper *)progmem_ptr
#define F6(progmem_ptr) (const __FlashStringHelper *)progmem_ptr
#define F7(progmem_ptr) (const __FlashStringHelper *)progmem_ptr
#define F8(progmem_ptr) (const __FlashStringHelper *)progmem_ptr
#define F9(progmem_ptr) (const __FlashStringHelper *)progmem_ptr
#define F10(progmem_ptr) (const __FlashStringHelper *)progmem_ptr
#define F11(progmem_ptr) (const __FlashStringHelper *)progmem_ptr
Why do you think that you need so many identical defined macros? Can't you just define it once and use it over and over?
Delta_G:
#define F2(progmem_ptr) (const __FlashStringHelper *)progmem_ptr
#define F3(progmem_ptr) (const __FlashStringHelper *)progmem_ptr
#define F4(progmem_ptr) (const __FlashStringHelper *)progmem_ptr
#define F5(progmem_ptr) (const __FlashStringHelper *)progmem_ptr
#define F6(progmem_ptr) (const __FlashStringHelper *)progmem_ptr
#define F7(progmem_ptr) (const __FlashStringHelper *)progmem_ptr
#define F8(progmem_ptr) (const __FlashStringHelper *)progmem_ptr
#define F9(progmem_ptr) (const __FlashStringHelper *)progmem_ptr
#define F10(progmem_ptr) (const __FlashStringHelper *)progmem_ptr
#define F11(progmem_ptr) (const __FlashStringHelper *)progmem_ptr
Why do you think that you need so many identical defined macros? Can't you just define it once and use it over and over?
Hm, Im not a expert of programming, still learning. How can I do that?
Its planned to use for show Nickname and lap time for RC car.
A example that i think (using serial, but ill do it later):
1 DragonII
00:09:354 L:5 (L means laps count)
2 Janne
00:10:410 L:4 etc up to 5 players.
DragonII:
How can I do that?
Just use the same macro for ALL text...
#define FS(x) (const __FlashStringHelper *)(x)
//...
Serial.print(FS(SomeString));
Serail.print(FS(AnotherString));
Serial.print(FS(JustFoundAnotherString));
//etc
And what the, "Mega's limited amount of memory"!? I'm not sure what you're doing but a Mega has a ton of memory compared to a Uno. And I rarely fill up an Uno!
septillion:
And what the, "Mega's limited amount of memory"!? I'm not sure what you're doing but a Mega has a ton of memory compared to a Uno. And I rarely fill up an Uno!
Hm, someone said if use a 64*32 RGB panel= (64x32x3=6144) so it will be ok. If i adding 1 more (64x32 too and chained together to a 64x64 or 128x32) so it will be 12288.
References to another link: Cloned display panels - LEDs and Multiplexing - Arduino Forum
And a movie: https://youtu.be/uHXXFyOAQ9E
If you want all of that in memory, yes, you need a lot. But I would not start a project that uses so much memory without understanding it full. As always, baby steps
As I said earlier, so I have to use ONE panel, not two and make it scrollable text.
If you saw movie on link, you see that text scrolling and stop at line 8 and start over.
The text will be controlled by serial (other software), but will add it later.