lasercutter/arduino/SafetyBoard4/password.ino
2017-07-09 19:58:38 +02:00

41 lines
1.3 KiB
C++

//#include "safetyboard.h";
//******************************************************
// Password related stuff
//******************************************************
//take care of some special events
void pwdKeypadEvent(KeypadEvent eKey) {
switch (kpd.getState()){
case PRESSED:
menuPasswordReset();
switch (eKey){
case '*':
checkPassword();
break;
case '#':
password.reset();
break;
default:
password.append(eKey);
}
}
}
void checkPassword() {
if (password.evaluate()) {
Serial.println("Success");
lcd.clear();
passwordCorrect = true;
setupFlowMeter();
digitalWrite(airAssistPin, LOW); // sets the airAssist on
digitalWrite(ventilationPin, LOW); // sets the air ventilation on
digitalWrite(waterCoolerPin, LOW); // sets the watercooler fans on
digitalWrite(laserEnablePin, LOW); // sets the watercooler fans on
digitalWrite(lichtPin, LOW); // sets the licht pin (inverted) on
digitalWrite(powerWH, LOW); // sets the waterpump and high voltage on
menuType = 1; // inportant information
kpd.addEventListener(menuKeypadEvent); //add an event listener for this keypad
} else {
Serial.println("Wrong");
password.reset();
menuPasswordWrong();
}
}