My setup:
--> Board - Feather M4 Express
--> OLED - OLED FeatherWing SH1107 (128x64)
--> Coding - Arduino IDE
Project:
--> Is there a way to scroll a line of text off of the OLED screen? Meaning all the way off the screen and not to reapear from the other side.
Appreciate any guidance!
Code: Select all
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SH110X.h>
Adafruit_SH1107 display = Adafruit_SH1107(64, 128, &Wire);
// OLED FeatherWing buttons map to different pins depending on board:
#if defined(ESP8266)
#define BUTTON_A 0
#define BUTTON_B 16
#define BUTTON_C 2
#elif defined(ESP32) && !defined(ARDUINO_ADAFRUIT_FEATHER_ESP32S2)
#define BUTTON_A 15
#define BUTTON_B 32
#define BUTTON_C 14
#elif defined(ARDUINO_STM32_FEATHER)
#define BUTTON_A PA15
#define BUTTON_B PC7
#define BUTTON_C PC5
#elif defined(TEENSYDUINO)
#define BUTTON_A 4
#define BUTTON_B 3
#define BUTTON_C 8
#elif defined(ARDUINO_NRF52832_FEATHER)
#define BUTTON_A 31
#define BUTTON_B 30
#define BUTTON_C 27
#else // 32u4, M0, M4, nrf52840, esp32-s2 and 328p
#define BUTTON_A 9
#define BUTTON_B 6
#define BUTTON_C 5
#endif
void setup() {
delay(250); // wait for the OLED to power up
display.begin(0x3C, true); // Address 0x3C default
display.display();
delay(1000);
// Clear the buffer.
display.clearDisplay();
display.display();
display.setRotation(1);
pinMode(BUTTON_A, INPUT_PULLUP);
pinMode(BUTTON_B, INPUT_PULLUP);
pinMode(BUTTON_C, INPUT_PULLUP);
display.setTextSize(1);
display.setTextColor(SH110X_WHITE);
}
//*************************************** Begin Main Loop *******************************************
void loop() {
display.setCursor(0,0);
display.println("Ham is Good, Ham is Life, All Hail Ham!");
//Would like to scroll the above text to the left and off the screen.
delay(10);
yield();
display.display();
}
//*************************************** End Main Loop *******************************************