#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.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);
#include<LiquidCrystal.h>
int buttonState = 0;
const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
const int buttonPin = 1; // the number of the pushbutton pin
byte love [] {
B00000,
B00000,
B00000,
B01010,
B10101,
B10001,
B01010,
B00100,
}
;
byte stick [] {
B01110,
B01110,
B00100,
B11111,
B00100,
B00100,
B01010,
B10001,
}
;
void setup() {
display.display();
delay(2000); // Pause for 2 seconds
lcd.begin(0, 0);
lcd.setCursor(0, 0);
pinMode(buttonPin, INPUT);
}
void loop() {
buttonState = digitalRead(buttonPin);
if (buttonState == HIGH) {
lcd.clear();
lcd.setCursor(0, 0);
lcd.createChar(6, love);
tone(7, 60, 1000);
} else {
lcd.clear();
lcd.setCursor(0, 0);
tone(7, 50, 1000);
display.print("yolo");
lcd.print("yolo");
}
}