P10 display column split with dmd2

thanks for hellping me

@ottodelvitto , your topic has been moved to a more suitable location on the forum. Installation and Troubleshooting is not for problems with (nor for advise on) your project.

Personally, I’d switch to use c-strings… you have tighter control over the processing of real time data… less chance of ‘glitches’ in the timing.

Also - get rid of those delays, and come back to us…

Nice idea that can be executed more cleanly.

Note solving your problem but some observations

Please explain what you think that strlen in the below line does

 String tug = varA.substring(0, strlen);

Below will eventually bugger up your EEPROM; why would you write the same value to EEPROM in one for-loop and again in a second for-loop? You're further advised to use EEPROM.put() instead of EEPROM.write().

  if (Serial.available() > 0) {
    for (i = 0; i < 499; i++) {
      EEPROM.write(i, 0);
    }
    for (i = 0; i < 499; i++) {
      runningText[i] = '\0';
      EEPROM.write(i, runningText[i]);
    }
    index = 0;
  }

Why do you use the begin() method of the DMD objects all over the show? Usually they are only called from setup().

Yes my Friend, thansk for replay.. i already fix and more shorten my code so more easier. i dont know actualy how to make limit margin for left scrolling. using boudrate 9600 for send text . example : 1A| Chicago - Kansas , that mean with seperator "|" i can use for 1A (stay Display) and Chicago - Kansas is scrolling text, i already did it, but im not so satisfied because screen seem not smooth, its break when moving the text. im using DMD2.

#include <SPI.h>
#include <DMD2.h>
#include <fonts/SystemFont5x7.h>
#include <fontTje.h>
#include <EEPROM.h>
#include "Arduino.h"
char rChar;
const int WIDTH = 2;
const uint8_t *FONT = fontTje;
int panjang;
SoftDMD dmd(2, 1);
SoftDMD dmd1(2, 1);
DMD_TextBox box(dmd1, 0, 1);
DMD_TextBox box1(dmd, 20, 1);
String command;
String readString;
int i;
int counting = 1;
#define maxChar 500
char runningText[maxChar];
byte index;


void ep() {

  if (Serial.available() > 0 ) {
    for (i = 0; i < 499; i++) {
      EEPROM.write(i, 0);
    }
    for (i = 0; i < 499; i++) {
      runningText[i] = '\0';
      EEPROM.write(i, runningText[i]);
    }
    index = 0;
  }
  while (Serial.available() > 0) {
    if (index < (maxChar - 1)) {
      rChar = Serial.read();
    
      runningText[index] = rChar;

      EEPROM.write(index, runningText[index]);
      index++;
      runningText[index] = '\0';
    }
  }
  for (i = 0; i < 499; i++) {
    runningText[i] = EEPROM.read(i);
  }
}
void setup() {
  Serial.begin(9800);
  dmd.setBrightness(500);
dmd.selectFont(FONT);
  dmd.begin();
  ep();
}
void des () {
  ep();
  String varA = runningText;
  String tug = varA.substring(0, strlen);
  const char* hub = tug.c_str();
  char* cim = strtok(hub, "|");
  dmd1.selectFont(FONT);
  String sep = "|";
  String a = cim + sep;
  a.trim();
  panjang = a.length() * 8 - 1;
  (panjang);
  dmd.begin();
  dmd.drawString(0, 1, a );
}

void loop(void) {

  ep();

  des();
 
  xscr();
}
void xscr() {
  String varA = runningText;
  String tax = varA.substring(0, strlen);
  const char* mg = tax.c_str();
  String tx = strtok(mg, "|");
  String v = "|";
  String scr = tx + v;
  const char* mk = scr.c_str();
  char* sctext = strtok(NULL, "|");
  String myString = String(sctext);
  myString.trim();

  const char *next = sctext;
  while (*next) {
    Serial.print(*next);
    box1.print(*next);
    delay(100);
    next++;
  }
  box.clear();

}

i hope to master will guide me because am beginer in programing arduino