how to split up (16x2) display for multiple values?

Hi all!

Im trying to learn how to handle a future display but im drawing blanks since i dont know what to search for..

The idea is to split a single line of a display into segments, for instance, having the top line of a 16x2 display show both speed and distance, something like: "123Kmh_ODO:1234K"

From my research i have found ../www.arduino.cc/../StringAdditionOperator.
It kind of answers my prayers, but i cant understand how to "nail" each segment to its allotted display position, so "ODO" (from the example above) wont get pushed around when the "Kmh" and "K" values change.

Im sorry for a bad explanation, but to put it in another way; i would want a way to have a 16 char display buffer container (array?) where the first 3 digits are reserved for "currentSpeed"(123), then a static text block;"Kmh_ODO:" followed with "currentOdo"(1234), 4 digits and lastly a "K" for Km.

And to be clear, im not actually writing a program with this feature at this moment, this is pure research.. :slight_smile:

To "nail" output text to a particular place on the display, position the text first, then print the data. For example, here is some code I have written that does this:

...
      display.setTextSize(1);
      display.setCursor(10, 15);
      display.print(F("DST:"));

      display.setTextSize(2);
      display.setCursor(49, 12);
      if (isDST != 0) {                   // isDST is true if not in Arizona
        display.print(F("NORMAL"));
      } else {
        display.print(F("NEVER"));
      }
...

Kmh and ODO can be displayed permanently if you print this in void setup().
With lcd.setCursor() you can point to where on the LCD you want to print the variables.
They can be written/updated to that line and position in void loop().
Leo..

Hi,
Examples of putting data on LCD display are HERE:

Notice how the resolution/number of characters to display is set...

You don't need to put the sections into one string. Just use
lcd.setCursor() like:

// Print our characters on the LCD
// NOTE: Line number and character number start at 0 not 1
  
  lcd.setCursor(0,0); //Start at character 0 on line 0
  lcd.print("1: ");
  displayTemperature(Probe01);

... do yourself a favor and learn to use this Big Boy tool:
http://arduiniana.org/libraries/streaming/

Ray