Output of multi-line text to the display

There is a 128x64 pixel display. The u8g2 library. There is also a String variable that stores large and multi-line text. How to display a scrollable button?

Can you explain what that means?

1 Like

Scrolling text through a button on the board

How do you get the text through the button. I would think the button controls the text display on the screen.

You must make your own scrolling...

#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64
#define OLED_RESET -1
#define SCREEN_ADDRESS 0x3C
Adafruit_SSD1306 display (SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);

void setup () {
  if (!display.begin(SSD1306_SWITCHCAPVCC, SCREEN_ADDRESS))
    for (;;); // halt here

  display.clearDisplay();
  display.setTextSize(1);

  pinMode(2, INPUT_PULLUP);
  while (digitalRead(2)){;;}

  for (int i = 63; i > 0; i -= 3) {
    display.setTextColor(WHITE);
    display.setCursor(0, i);
    display.println(F("Twas brillig, and the\nslithy toves Did gyre\nand gimble in th wabe\n  All mimsy were the\n  borogoves, And the\n mome raths outgrabe."));
    display.display();
    display.clearDisplay();
  }
}

void loop() { }

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