#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include <EEPROM.h>
#define OLED_RESET 4
Adafruit_SSD1306 display(OLED_RESET);
const int studentIDAddress = 0;
const String studentID = "103807725";
void setup() {
display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
display.clearDisplay();
display.setTextColor(WHITE);
display.setTextSize(1);
display.setCursor(0, 0);
// Write your student ID to the EEPROM
for (int i = 0; i < studentID.length(); i++) {
EEPROM.write(studentIDAddress + i, studentID[i]);
}
delay(10);
// Read the student ID from the EEPROM and display it on the OLED display
String value;
for (int i = 0; i < studentID.length(); i++) {
char c = EEPROM.read(studentIDAddress + i);
value += c;
}
display.print("Student ID: ");
display.println(value);
display.display();
}
void loop() {
// Nothing to do here
}