Announcement

Collapse
No announcement yet.

Problems with strings

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problems with strings


    Dear community, I've been working with the display "# SK-GEN4-50DCT-CLB #" and a Teensy 3.6 for some time. , Unfortunately I have the problem that some ads flicker when updated, other ads do not flicker and again there are ads that only flicker at start and the flickering then improves at some point. I suspect it is related to the length of the text and / or the size of the text field. Is there information about the circumstances under which this problem occurs and how I can possibly solve it by precaching or something? I tested with a minimal version of the ad:

    #include <genieArduino.h> // Konfiguration // ----------------------------------------------------- #define PC Serial #define Display Serial1 const int BaudPC = 9600; const int BaudDisplay = 9600; // Konfiguration Display // ----------------------------------------------------- Genie genie; #define RESETLINE 2 // Hier Resetpin für das Display eintragen // ----------------------------------------------------- long Zahl; float Count = 111.11; // Setup // ----------------------------------------------------- // ----------------------------------------------------- void setup() { // Setup Serial // --------------------------------------------------- Display.begin(BaudDisplay); PC.begin(BaudPC); Display.flush(); PC.flush(); delay(10); genie.Begin(Display); // --------------------------------------------------- // Setup Display // --------------------------------------------------- pinMode(RESETLINE, OUTPUT); digitalWrite(RESETLINE, 0); // Reset delay(100); digitalWrite(RESETLINE, 1); // unReset delay (5000); //


    let the display start up after the reset (This is important)

    Video: https://youtu.be/XP2mVo6eVas Thanks Hermann
    Last edited by hermann2971; 2 weeks ago.

  • #2
    #include <genieArduino.h>


    // Konfiguration
    // -----------------------------------------------------
    #define PC Serial
    #define Display Serial1

    const int BaudPC = 9600;
    const int BaudDisplay = 9600;


    // Konfiguration Display
    // -----------------------------------------------------
    Genie genie;

    #define RESETLINE 2 // Hier Resetpin für das Display eintragen
    // -----------------------------------------------------


    long Zahl;
    float Count = 111.11;


    // Setup
    // -----------------------------------------------------
    // -----------------------------------------------------
    void setup() {

    // Setup Serial
    // ---------------------------------------------------
    Display.begin(BaudDisplay);
    PC.begin(BaudPC);
    Display.flush();
    PC.flush();
    delay(10);
    genie.Begin(Display);
    // ---------------------------------------------------


    // Setup Display
    // ---------------------------------------------------
    pinMode(RESETLINE, OUTPUT);

    digitalWrite(RESETLINE, 0); // Reset
    delay(100);
    digitalWrite(RESETLINE, 1); // unReset

    delay (5000); //let the display start up after the reset (This is important)

    genie.WriteContrast(15); // 0 = Display OFF, though to 15 = Max Brightness ON.

    genie.WriteObject(GENIE_OBJ_USERIMAGES, 0x00, 1); // Hintergrundbild
    // ---------------------------------------------------

    }
    // -----------------------------------------------------
    // -----------------------------------------------------



    // Loop
    // -----------------------------------------------------
    // -----------------------------------------------------
    void loop() {

    Zahl = random (-2147483648,2147483648);
    String Text0 = String (Zahl);
    genie.WriteStr(0, Text0);
    delay(100);

    Zahl = random (-2147483648,2147483648);
    String Text1 = String (Count);
    genie.WriteStr(1, Text1);
    delay(100);

    String Text2 = String (Count) +"abcde";
    genie.WriteStr(2, Text2);
    delay(100);

    Count = Count + 0.10;
    }
    // -----------------------------------------------------
    // -----------------------------------------------------
    Last edited by hermann2971; 2 weeks ago.

    Comment


    • #3
      Hi Herman,

      The 'flicker' occurs because the text on the strings are being redrawn every time you send the genie.WriteStr command.

      As a workaround, you can try to do the instructions written on this forum thread: https://forum.4dsystems.com.au/node/...0186#post60186
      Edit C:\Program Files (x86)\4D Labs\4D Workshop 4 IDE\Include\CLPrintStrings.inc with a text editor.
      Comment out lines 15 and 17, by adding // at the front
      Change the word TRANSPARENT on line 28 to OPAQUE
      Save this file.
      Now rebuild your project.
      Best Regards,
      Kevin

      Comment


      • #4
        Hi Kevin,


        This time the string was printed just as i wish NO FLASHING but i have other problems now, I have the side effects that relate to background colours, that you've described in the forum.
        And i also have some digits of old strings that stuck in new strings.

        Could you please suggest me a solution to fix these issues?

        Thanks in advance,

        Hermann

        Comment


        • #5
          Hi Hermann,

          have the side effects that relate to background colours
          Can you upload your project file so I can see and test it at my end?

          And i also have some digits of old strings that stuck in new strings.
          Please try the suggestion mentioned on the forum thread:
          The main side effect that you might/will see is that if you print "abcd" followed by "123" that the "d" will still be visible, so you will need to pad out your sent strings with blanks (and, depending on the font type, 'double' blanks) to ensure that the old string is erased.
          Best Regards,
          Kevin

          Comment


          • #6

            Hi there I use 10 strings in the display, I can't change everything !! That is far too much work. Have you attached both videos compare With 6 seconds it fits the plinking

            https://youtu.be/6DwvB8BwtZ4

            https://youtu.be/V62NugvPwBE
            Thanks hermann

            Comment


            • #7
              Hi Herman,

              Based on what I see on the video, it seems that the character from the previous message was not being erased when a shorter character length is sent on the display.
              As mentioned in the previous thread, you need to append spaces/blanks to erase the string. Depending on the character size, a double space may be needed.

              Here is a snippet of code for an additional reference:
              Code:
              int tmp, len;
              String Text2 ;
              unsigned long prevTime;
              
              void loop()
                if (millis() - prevTime > 1000)             // update the count every sec
                {
                  Text2 = String(random (0,50000));
                  len = Text2.length();
                  if(tmp!=len){
                    genie.WriteStr(5, Text2 + AppendSpaces());
                    tmp = Text2.length(); // save prev length
                  }
                  else{
                    //Although the text does not change, you need to offset for the size of each char.
                    //Just in case, append an additional space
                    genie.WriteStr(5, Text2 + " ");
                    Serial.println("Does not change!");
                  }  
                  prevTime = millis();
                }
              }
              
              String AppendSpaces(){
                  int i;
                  String spaces;
              
                  //5 is the MAX chars, however, the size for the 'space' is different, so an offset is needed. Adjust this value accordingly
                  for(i = len; i<=7; i++){
                    spaces+=" ";
                  }
                  return spaces; // return no of space to append
              }
              Let me know if that helps.

              Also, if that is not the issue, please do let me know.

              Best Regards,
              Kevin
              Last edited by John Kevin; 1 week ago.

              Comment

              Working...
              X