#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include "menu.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, &Wire, -1);
static const unsigned char PROGMEM cactus[] = {
0b10101,
0b01110,
0b01110,
0b11111,
0b01110,
0b01110,
0b11111,
0b01110
};
int command, selection = -1;
void setup() {
Serial1.begin(9600);
Serial1.println("READY");
if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) {
Serial1.println(("SSD1306 allocation failed"));
for(;;);
}
delay(2000);
}
void loop() {
if (Serial1.available() > 0) {
command = Serial1.read();
// Serial1.println(command, DEC);
getSelection(command, selection);
displayMenu(display, selection, 3);
}
delay(1); // this speeds up the simulation
}