/*
* This ESP32 code is created by esp32io.com
*
* This ESP32 code is released in the public domain
*
* For more detail (instruction and wiring diagram), visit https://esp32io.com/tutorials/esp32-oled
*/
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define SCREEN_WIDTH 128 // OLED width, in pixels
#define SCREEN_HEIGHT 64 // OLED height, in pixels
#define vert 5
#define horiz 17
#define butt 18
int posx = 64;
int posy = 32;
// create an OLED display object connected to I2C
Adafruit_SSD1306 oled(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1);
void setup() {
Serial.begin(9600);
// initialize OLED display with I2C address 0x3C
if (!oled.begin(SSD1306_SWITCHCAPVCC, 0x3C)) {
Serial.println(F("failed to start SSD1306 OLED"));
while (1);
}
delay(2000); // wait two seconds for initializing
oled.setCursor(0, 0);
oled.clearDisplay();
}
void loop() {
oled.fillCircle(20, 55, 10, WHITE);
oled.display();
oled.fillCircle(20, 55, 5, BLACK);
oled.display();
oled.fillCircle(20, 40, 7, WHITE);
oled.display();
oled.fillCircle(20, 40, 4, BLACK);
oled.display();
oled.fillCircle(20, 30, 5, WHITE);
oled.display();
oled.fillCircle(18, 30, 1, BLACK);
oled.display();
oled.fillCircle(22, 30, 1, BLACK);
oled.display();
oled.drawTriangle(80, 62, 128, 32, 104, 32, WHITE);
oled.display();
}