LCDs do not display values in any cases

Good morning!

This sketch ( Messwerte Messschieber auf 16x2LCD richtig darstellen - #21 by system - Deutsch - Arduino Forum ) works properly with 3 connected calipers. I want to use it on both the milling machine and on the lathe. However, on the lathe, I have only 2 calipers (X and Y axis) that can be connected.
But if the Z-axis caliper is not connected, no values ??appear in the displays for the X and Y axis. What has to be changed in the code?

regards

Safran

What code?

Hi AWOL !

The code i posted is shown in the linked thread ( please scroll up a little bit ). It is long and therefore i think it´s better not to post it twice.

regards

Dafran

It's not that long, and I don't really mind if it is posted twice as long as it is posted correctly

Hi AWOL,

if the sketch is posted incorrectly, please give an example to do it better.

regards

Safran

Like this:

void setup ()
{
}

void loop ()
{
}

Just like it is described in the guidelines posted at the top of nearly every section of the forum

Ok, now i have posted the code correctly.
By the way, in the german issue of the arduino programm there is a menu item called: Für Forum kopieren ( copy to use in the forum ). I just used this menu item. Why is a menu item called like this when its wrong to use it?

Just rip out all the code that refers to the Z axis, or wrap it in "#ifdef".
I don't really see why reading the Y axis is dependent upon having read the X axis, and why reading the Z axis is dependent upon having read the Y axis.
I also don't really see why there are three virtually identical axis decode functions.

I have no idea why "copy for forum" still exists.
I really wish it didn't