Text display problem on an oled screen

Hello everyone I have a school project to set up and I would like to know if it would be possible to integrate the whole text on the screen with the u8x8 library I use a 128x128 screen here is the result I would like to have

here is the result I have on my screen

Here is the code I use

#include <Arduino.h>
#include <U8x8lib.h>

#ifdef U8X8_HAVE_HW_SPI
#include <SPI.h>
U8X8_SSD1306_128X64_ALT0_HW_I2C u8x8(/* reset=*/ U8X8_PIN_NONE); 	     

void setup(void)

void loop(void)
  u8x8.drawString(0,1,"ed nibh tincidunt feu giat. Maecenas enim massa, fringilla sed malesuada");

I expect you would get a better response in one of the arduino code forums, as this really isn’t related to Fritzing but rather Arduino coding.


Without looking at the code in the library, the ‘obvious’ answer would be that it does not automatically wrap to the next line when reaching the edge of the display. If there is a flag to tell u8x8.drawString to wrap text, that would do it. Otherwise, you need to split your string into shorter lengths, and draw each segment on a separate line. An array of strings where the index matches the target line number would allow a simple loop to do that.