/*
MAKE SURE TO USE VERSION 1.6 of the ESP32 library
*/
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
/* Menu definitions */
#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 32
#define OLED_RESET -1
#define SCREEN_ADDRESS 0x3C
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
void setup() {
// Setup Serial
Serial.begin(115200);
// Start Screen
if(!display.begin(SSD1306_SWITCHCAPVCC, SCREEN_ADDRESS)) {
Serial.println(F("SSD1306 allocation failed"));
for(;;);
}
// Clear the buffer
display.clearDisplay();
// Set text color to white
display.setTextColor(SSD1306_WHITE);
// Set text size to 1 (normal)
display.setTextSize(1);
// Set cursor to (0,0)
display.setCursor(0,0);
// Print message
display.println("Hello, world!");
// Display the message
display.display();
Serial.println("Should have displayed");
}
void PrintText(String text,int TextSize){
// Clear the buffer
display.clearDisplay();
// Set text color to white
display.setTextColor(SSD1306_WHITE);
// Set text size to 1 (normal)
display.setTextSize(TextSize);
// Set cursor to (0,0)
display.setCursor(0,0);
// Print message
display.println(text);
// Display the message
display.display();
}
void dinges(){
// Clear the buffer
display.clearDisplay();
// Set text color to white
display.setTextColor(SSD1306_WHITE);
// Set text size to 1 (normal)
display.setTextSize(3);
// Set cursor to (0,0)
display.setCursor(0,0);
display.print("> ");
display.setTextColor(SSD1306_INVERSE);
display.print("1");
display.setTextColor(SSD1306_INVERSE);
display.print("2");
display.setTextColor(SSD1306_INVERSE);
display.print("3");
display.setTextColor(SSD1306_INVERSE);
display.print(".");
display.setTextColor(SSD1306_INVERSE);
display.print(".");
display.setTextColor(SSD1306_INVERSE);
display.print("#");
display.display();
}
void loop() {
void dinges()
}