random values using caliper--->arduino---> TV(Pal)

Hi, i´m trying to display a caliper value on a tv using tvout.h and fontALL.h.
First I tested the hardware with the example sketch called Mandelbrot and it was running well.
Then I connected the caliper to the arduino ( i´m using the nano ) and uploaded the following sketch:

#include <TVout.h>
#include <fontALL.h>
#include <LiquidCrystal.h>  
TVout TV;
LiquidCrystal x(12, 8, 5,4,3,2);
int ix;     //x ist für die x-Achse
int signx;
long valuex;
float resultx;
int clockpinx = 10;  
int datapinx = 6;
unsigned long tempmicrosx;

void setup() 
{
    //Serial.begin(9600);
    pinMode(clockpinx, INPUT);
    pinMode(datapinx, INPUT);
    x.begin(16,2);
      
    TV.begin(_PAL, 128, 96);
    TV.clear_screen();
    TV.select_font(font8x8);
}
 void loop () 
   {
        while (digitalRead(clockpinx)==LOW) {} //so lange Pegel LOW ist, soll der Wert von
        tempmicrosx=micros();// tempmicrosx dem Wert von micros() entsprechen
          while (digitalRead(clockpinx)==HIGH) {} //wenn Pegel auf LOW geht, behält tempmicrosx seinen Wert, die micros() zählen weiter hoch
            if ((micros()-tempmicrosx)>500) // sobald micros() um mehr als 500 größer geworden ist als tempmicrox, 
           { 
           decodex(); //wird die Prozedur decodex() aufgerufen
           }
   }
   
void decodex() 
{
    signx=1;
    valuex=0;
    for (ix=0;ix<23;ix++) 
    {
  
        while (digitalRead(clockpinx)==LOW) { } 
    
        while (digitalRead(clockpinx)==HIGH) {} 
    
        if (digitalRead(datapinx)==HIGH) 
       {
           if (ix<20) 
           {
             valuex|= 1<<ix;
           }
             if (ix==20) 
                {  
                    signx=-1;  
                }
        }
    }
    resultx=(valuex*signx)/100.00; //Messwert x Vorzeichen/100 ergibt Meßwert mit 2 Stellen hinter dem Komma
      
    if (resultx<-999.99) resultx=-999.99;
    if (resultx>999.99) resultx=999.99;
    char strResultx[8];
    dtostrf(resultx,8,2,strResultx);
    TV.print(1, 1, "X : ");
    TV.print(30, 1,strResultx);
    TV.print(100, 1 ,"mm");
    x.print ("X-Achse");
    x.setCursor(0,1);
    x.print(strResultx);
    x.print(" mm     ");
     Serial.print(strResultx);
}

The sketch is running well if only the LCD-Part is activated ( all the TV-Parts are inactivated by commenting them with // ).
If the TV-Parts are activated also, both LCD and TV show random values and only from time to time the values which are sent from the caliper to arduino.
If only the TV-Part is activated, the values also are random.
Looking for the mistake, I found that random values are shown when the row

void setup() { TV.begin(_PAL, 128, 96);

is activated.
I have no idea to fix the problem. Any suggestions?

regards

Safran

The TV buffer takes a lot of memory space. Try using a lower resolution.

Hi, John !

I just tried out several resolutions down to TV.begin(_PAL, 36,24) and fonts like (font4x6), but it does not fix the problem.

In addition to my first post, i need to say that the caliper sends 1 *24-bit-data almost 10 times a second. Is it possible that all the arduinos are too slow to process the data from the caliper and the TV ?

regards

Safran

I just tried it using an arduino mega with 8 KB, but the problem is still the same :(.