#include "pass.h"
#include <Wire.h>
#include <Adafruit_SSD1306.h>
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels
#define I2C_SDA 26
#define I2C_SCL 25
// Declaration for an SSD1306 display connected to I2C (SDA, SCL pins)
#define OLED_RESET 4 // Reset pin # (or -1 if sharing Arduino reset pin)
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
char keyevent;
char firstevent = '1';
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Wire.begin(I2C_SDA, I2C_SCL);
// SSD1306_SWITCHCAPVCC = generate display voltage from 3.3V internally
if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3)) { // Address 0x3D for 128x64
Serial.println(F("SSD1306 allocation failed"));
for(;;); // Don't proceed, loop forever
display.setTextSize(1);
display.setTextColor(WHITE);
}
}
void loop() {
// put your main code here, to run repeatedly:
keyevent = keypad.getKey();
if (keyevent == firstevent){
setup_p();
loop_p();
Serial.println("complete");
}
display.clearDisplay();
display.setCursor(0, 0);
display.println("Welcome");
display.setCursor(0, 8);
display.println("This is");
display.setCursor(0, 16);
display.println("a Splash");
display.println("Screen");
display.display();
delay(5000);
}