# include <Adafruit_GFX.h>
# include <Adafruit_SSD1306.h>
# include <SPI.h>
# include <Wire.h>
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1);
int radius = 7;
int change = 2;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Hello, ESP32!");
if (!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) {
Serial.println(F("failed to start SSD1306 display"));
while (1);
}
display.setCursor(0,0);
}
void loop() {
//face
display.clearDisplay();
display.drawCircle(50, 30, 30, WHITE);
display.drawCircle(33, 20, 5, WHITE);
display.drawCircle(67, 20, 5, WHITE);
display.drawCircle(50, 45, radius, WHITE);
delay(10);
if(radius < 4){
change = 1;
}
else if(radius > 7){
change = 2;
}
if( change == 1){
radius++;
}
if( change == 2){
radius--;
}
display.display();
}