#include <gLCD.h>
const char RST = 8;
const char CS = 9;
const char Clk = 13;
const char Data = 11;
#define right A0
#define left A2
gLCD graphic(RST, CS, Clk, Data, HIGH_SPEED);
void setup() {
Serial.begin(9600);
pinMode(right, INPUT_PULLUP);
pinMode(left, INPUT_PULLUP);
graphic.begin(0, 0, 0, PHILLIPS_0);
graphic.setBackColour(0, 0, 0);
graphic.Clear();
graphic.set_brightness(100);
}
bool toggle;
void loop() {
int inputr = digitalRead(right);
int inputl = digitalRead(left);
Serial.println(inputr);
Serial.println(inputl);
graphic.Clear();
graphic.setCoordinate(32,66);
if (inputr == LOW) {
toggle = true;
}
if (inputl == LOW) {
toggle = false;
}
if (toggle == true) {
graphic.setBackColour(0, 1, 0);
graphic.print("Unlocked");
}
if (toggle == false) {
graphic.setBackColour(1, 0, 0);
graphic.print("Locked");
}
delay (500);
}