u8g2.println

Hello,
I am very new to this arduino programming.
I use a "Wifi Kit 32" with oled display. I wanted to test different ways of writing to the screen.
In u8g2 both print and println are implemented, but I don't see any difference. Either one I use, the next print command writes directly behind the line before. So there is no cr/lf performed. Also when I include \r\n codes in the print statement it doesn't advance to the next line.

Why is this so? Do I have to activate something that also vertical cursor position gets automatically modified, and not only horizontal position?

It only handles print()
But since it remembers where the horizontal cursor is you don’t have to setCursor() for subsequent items on the same line.

i.e. it is easier than using drawStr()

This is seldom a problem with small 128x64 displays.

I suggest that you do your own experiments.

David.

#include <U8g2lib.h>

U8G2_SH1106_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE);    //

int lineht;

void setup()
{
    u8g2.begin();
    u8g2.setFont(u8g2_font_ncenB14_tr);
    u8g2.setFontPosTop();
    //u8g2.setFontMode(1);
    //u8g2.setDrawColor(1);
    lineht = u8g2.getMaxCharHeight();
}

void loop()
{
    u8g2.clear();     //clears buffer and updates physical display
    delay(2000);
    u8g2.setCursor(0, 0); //start at the beginning
    u8g2.print("David");
    u8g2.updateDisplay(); //show it
    delay(2000);
    u8g2.setCursor(0, lineht); //start on next line
    u8g2.print("Prentice");
    u8g2.updateDisplay(); //show it
    delay(2000);
}

Ok, then it is confusing at least that println is implemented and compiled without error, despite beeing not documented.
And I incorrectly assumed obviously, that \r\n would be handled like in serial.print.

I agree with you.

But it is seldom a problem with small displays.

It is easy to implement \r and \n. Perhaps this will be implemented in the future.
Mind you, U8g2 can handle utf8 and Unifont text. Something that few other Arduino libraries can do.

David.