#include <Adafruit_SSD1306.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
//declaring my new lcd and naming it "screen
Adafruit_SSD1306 screen(128,64,&Wire, -1);
//(pixels wide, pixels tall, wire library, -1 is for the uno board reset pin)
int address = 60; //0x3C; //means 12 (C) plus 3 16s or 48
//12 + 48 is 60.
int button = 3;
void setup() {
pinMode(button,INPUT);
// put your setup code here, to run once:
screen.begin(SSD1306_SWITCHCAPVCC,address);
screen.clearDisplay();//wipe everything off the screen
delay(5);
}
void loop() {
screen.setCursor(0,10);//x,y position to set cursor
screen.setTextSize(1);//1 is a good starting size
screen.setTextColor(1);//1 is white, 0 is black
if(digitalRead(button)){
screen.setTextSize(3);
screen.print("PRESSED");
}
else{
screen.setTextSize(1);
screen.print("not pressed :(");
}
screen.display();//finalizes all instructions to display
delay(50);
screen.clearDisplay();
}