
#include <LiquidCrystal.h>
#include <Keypad.h>
#include <Password.h>
#include "safetyboard.h"

void setup() {
  pinMode(airAssistPin, OUTPUT);          // sets the digital pin as output
  pinMode(ventilationPin, OUTPUT);        // sets the digital pin as output
  pinMode(waterCoolerPin, OUTPUT);        // sets the digital pin as output
  pinMode(laserEnablePin, OUTPUT);        // sets the digital pin as output
  pinMode(lichtPin, OUTPUT);             // sets the digital pin as output
  pinMode(testEnablePin, OUTPUT);         // sets the digital pin as output
  pinMode(potMeterEnable, OUTPUT);        // sets the digital pin as output 
  pinMode(powerWH, OUTPUT);        // sets the digital pin as output 
  
  digitalWrite(airAssistPin, HIGH);        // sets the airAssist off
  digitalWrite(ventilationPin, HIGH);      // sets the air ventilation off
  digitalWrite(waterCoolerPin, HIGH);      // sets the watercooler off
  digitalWrite(laserEnablePin, HIGH);      // sets the laserEnable off
  digitalWrite(lichtPin, HIGH);            // sets the licht pin  (inverted) off
  digitalWrite(testEnablePin, HIGH);       // sets the test enable pin () off
  digitalWrite(potMeterEnable, HIGH);      // sets the watercooler fans off 
  digitalWrite(powerWH, HIGH);             // sets the waterpump and high voltage off
  Serial.begin(9600);
  firstMenu();
  kpd.addEventListener(pwdKeypadEvent); //add an event listener for this keypad
}
void loop() {
  if (passwordCorrect) {
    checkMenu();
    checkFlow();
  } else {
    kpd.getKey(); 
  }
}
