Scroll text on Oled 0.96 I2C

Hi, im having trouble scrolling text in Oled display SSD1306, im not using Adafruit library , im using this GitHub - LilyGO/ESP32-OLED0.96-ssd1306 because i have the ESP32 CAM. So the thing is that i can scroll the text, but i dont want to move EVERYTHING to left, just the text.


Dont wanna scroll the wifi logo, im using strings so what can i do?

Where are you stuck ?

You know where you want the text to start
You know which is the first character of the string to print
You know how many characters of the string will fit on the screen

Hmm the string can be variable. i had the idea to convert the string into a char array and then access and rotate the characters on the array, but it seems really to much work. So i was wondering if there was a better way to approach the problem.

Ok i solved it by myself , i just ended up scrolling the entire substring with this function.

String leftrotate(String str, int d){
   String ans = str.substring(d,str.length()-d) + str.substring(0, d);
   return ans;
}

I preferred it when you suggested using C style strings rather than Strings but there is no need to move the characters around in the array. Move a pointer to the start of the text to be displayed instead

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.