//Include library
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include <Servo.h>
Servo myservo; //create servo object to control a servo
int pos = 8;
#define OLED_RESET 4
Adafruit_SSD1306 display(OLED_RESET);
int LED = 13;
void setup()
{
//Initialize display by providing the display type and its I2C address.
display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
//Set the text size and color.
display.setTextSize(1);
display.setTextColor(WHITE);
//Initialize digital 13
pinMode(LED, OUTPUT);
myservo.attach(8);
}
void loop()
{
//Clear previous image.
display.clearDisplay();
display.setCursor(0, 15);
display.print("brandy sandoval");
//Display changes if any were made.
display.display();
delay(1);
digitalWrite(LED, HIGH);
delay(2000);
digitalWrite(LED, LOW);
delay(1000);
for (pos = 0; pos <= 180; pos += 1){
myservo.write(pos);
delay(15);
}
for (pos = 180; pos >= 0; pos -= 1){
myservo.write(pos);
delay(15);
}
}