#include <Adafruit_SSD1306.h>
#include "Header.h"
Adafruit_SSD1306 display = Adafruit_SSD1306(128, 64, &Wire);
const int buttonPin = 2;
int buttonState = 0;
int state = 0;
void setup() {
Serial.begin(9600);
display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
display.display();
delay(500);
display.clearDisplay();
// initialize the pushbutton pin as an input:
pinMode(buttonPin, INPUT);
}
void text_test(){
display.setTextSize(0.5);
display.setCursor(20,20);
display.setTextColor(SSD1306_WHITE);
display.print("Welcome in state number 1");
};
void loop() {
//first, we initiate main objects
const General general(&display, buttonState);
while(1){
buttonState = digitalRead(buttonPin);
switch (state){
case 0:
//if the state is equal to 0 (default), we display main menu
general.DisplayMenu();
if(buttonState == HIGH) state = 1;
break;
case 1:
general.State1();
break;
case 2:
break;
}
}
// Show the display buffer on the screen. You MUST call display() after
// drawing commands to make them visible on screen!
//display.display();
}