#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define OLED_RESET 4
Adafruit_SSD1306 display(OLED_RESET);
char studentInfo[2][20] = {"103501645", "Kannangara"}; // Array of phrases to display
int currentPhrase = 0; // Index of current phrase to display
int scrollPos = 128; // Starting position of the phrase
void setup() {
display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
display.display();
delay(1000);
display.clearDisplay();
}
void loop() {
display.setTextSize(2);
display.setTextColor(WHITE);
int strLength = strlen(studentInfo[currentPhrase]);
display.setCursor(scrollPos, 16);
display.print(studentInfo[currentPhrase]);
display.display();
delay(1);
scrollPos--;
if (scrollPos < -strLength * 6) {
scrollPos = 128;
currentPhrase++;
if (currentPhrase >= 4) {
currentPhrase = 0;
}
display.clearDisplay();
}
display.display();
delay(1);
display.clearDisplay();
}