new stuff
This commit is contained in:
parent
84307e17f6
commit
cb18179fcb
@ -3,6 +3,9 @@
|
|||||||
#include <LiquidCrystal_I2C.h>
|
#include <LiquidCrystal_I2C.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
unsigned long systemClock; //-----------------SYSTEM CLOCK [VERY IMPORTANT]
|
||||||
|
unsigned long lastPulse; //-------------------LAST void loop() PULSE
|
||||||
|
|
||||||
char *firmwareRev = "1.1"; //VERSION
|
char *firmwareRev = "1.1"; //VERSION
|
||||||
int EEPROMVersion = 1; //version control to rewrite eeprom after update
|
int EEPROMVersion = 1; //version control to rewrite eeprom after update
|
||||||
int EEPROMBuild = 1;
|
int EEPROMBuild = 1;
|
||||||
@ -12,6 +15,7 @@ int EEPROMBuild = 1;
|
|||||||
bool fullAlarm = false; //bool to control if this is a full alarm that requres a panel reset to clear
|
bool fullAlarm = false; //bool to control if this is a full alarm that requres a panel reset to clear
|
||||||
bool silenced = false;
|
bool silenced = false;
|
||||||
bool keyInserted = false; //if the control panel has a key inserted
|
bool keyInserted = false; //if the control panel has a key inserted
|
||||||
|
bool readyLedStatus = false; //ready led status (this variable is for the trouble response code)
|
||||||
bool horn = false; //bool to control if the horns are active
|
bool horn = false; //bool to control if the horns are active
|
||||||
bool strobe = false; //bool to control if the strobes are active
|
bool strobe = false; //bool to control if the strobes are active
|
||||||
bool trouble = false; //bool to control if the panel is in trouble
|
bool trouble = false; //bool to control if the panel is in trouble
|
||||||
@ -36,11 +40,7 @@ int panelNameList[16];
|
|||||||
int clearTimer = 0; //timer for keeping track of button holding for clearing character in the name editor
|
int clearTimer = 0; //timer for keeping track of button holding for clearing character in the name editor
|
||||||
int verification = 0; //number to keep track of ms for verification
|
int verification = 0; //number to keep track of ms for verification
|
||||||
int drill = 0; //number to keep track of ms for drill
|
int drill = 0; //number to keep track of ms for drill
|
||||||
//------ void loop delays to lessen load
|
int buttonCheckTimer = 0; //add a slight delay to avoid double-clicking buttons
|
||||||
int deviceCheckTimer = 0;
|
|
||||||
int keyCheckTimer = 0;
|
|
||||||
int lcdCheckTimer = 0;
|
|
||||||
//------ void loop delays to lessen load
|
|
||||||
int troubleTimer = 0; //ms for trouble
|
int troubleTimer = 0; //ms for trouble
|
||||||
int codeWheelTimer = 0; //code wheel timing variable
|
int codeWheelTimer = 0; //code wheel timing variable
|
||||||
int troubleLedTimer = 0; //number to keep track of ms for trouble light
|
int troubleLedTimer = 0; //number to keep track of ms for trouble light
|
||||||
@ -70,6 +70,17 @@ byte lock[] = { //lock icon
|
|||||||
B00000
|
B00000
|
||||||
};
|
};
|
||||||
|
|
||||||
|
byte check[] = { //check mark icon
|
||||||
|
B00000,
|
||||||
|
B00001,
|
||||||
|
B00011,
|
||||||
|
B10110,
|
||||||
|
B11100,
|
||||||
|
B01000,
|
||||||
|
B00000,
|
||||||
|
B00000
|
||||||
|
};
|
||||||
|
|
||||||
//Default EEPROM values in the case that the EEPROM fails to load
|
//Default EEPROM values in the case that the EEPROM fails to load
|
||||||
bool keyRequired = false; //determine if key switch is required to operate buttons
|
bool keyRequired = false; //determine if key switch is required to operate buttons
|
||||||
bool isVerification = true; //is verification turned on
|
bool isVerification = true; //is verification turned on
|
||||||
@ -80,7 +91,7 @@ bool audibleSilence = true;
|
|||||||
int smokeDetectorTimeout = 5; //how long should smoke detector pre-alarm wait before cancelling the pre-alarm
|
int smokeDetectorTimeout = 5; //how long should smoke detector pre-alarm wait before cancelling the pre-alarm
|
||||||
int firstStageTime = 1; //time in minutes that first stage should last
|
int firstStageTime = 1; //time in minutes that first stage should last
|
||||||
int codeWheel = 0; //which alarm pattern to use, code-3 default
|
int codeWheel = 0; //which alarm pattern to use, code-3 default
|
||||||
int verificationTime = 2500;
|
int verificationTime = 250;
|
||||||
//int resistorLenience = 0; DEPRECATED
|
//int resistorLenience = 0; DEPRECATED
|
||||||
int panelHomescreen = 0;
|
int panelHomescreen = 0;
|
||||||
int lcdTimeout = 0;
|
int lcdTimeout = 0;
|
||||||
@ -215,6 +226,8 @@ void setup() {
|
|||||||
Serial.println("Initializing LCD...");
|
Serial.println("Initializing LCD...");
|
||||||
lcd.init(); //initialize LCD
|
lcd.init(); //initialize LCD
|
||||||
lcd.createChar(0, lock); //create the lock character
|
lcd.createChar(0, lock); //create the lock character
|
||||||
|
lcd.createChar(1, check); //create the lock character
|
||||||
|
|
||||||
lcd.backlight();
|
lcd.backlight();
|
||||||
|
|
||||||
//----------------------------------------------------------------------------- EEPROM RESET BUTTONS
|
//----------------------------------------------------------------------------- EEPROM RESET BUTTONS
|
||||||
@ -343,10 +356,10 @@ void setup() {
|
|||||||
}
|
}
|
||||||
smokeDetectorTimeout = EEPROM.read(77)*60000;
|
smokeDetectorTimeout = EEPROM.read(77)*60000;
|
||||||
firstStageTime = EEPROM.read(75)*60000;
|
firstStageTime = EEPROM.read(75)*60000;
|
||||||
verificationTime = EEPROM.read(10)*10;
|
verificationTime = EEPROM.read(10)*100;
|
||||||
//resistorLenience = EEPROM.read(72)*4; DEPRECATED
|
//resistorLenience = EEPROM.read(72)*4; DEPRECATED
|
||||||
panelHomescreen = EEPROM.read(78);
|
panelHomescreen = EEPROM.read(78);
|
||||||
lcdTimeout = EEPROM.read(80)*300;
|
lcdTimeout = EEPROM.read(80)*15000;
|
||||||
int x=0;
|
int x=0;
|
||||||
for (int i=11; i<=26; i++){ //read panel name
|
for (int i=11; i<=26; i++){ //read panel name
|
||||||
if (EEPROM.read(i) != 0){
|
if (EEPROM.read(i) != 0){
|
||||||
@ -363,9 +376,11 @@ void setup() {
|
|||||||
delay(100);
|
delay(100);
|
||||||
Serial.println("Config loaded");
|
Serial.println("Config loaded");
|
||||||
digitalWrite(readyLed, HIGH); //power on ready LED on startup
|
digitalWrite(readyLed, HIGH); //power on ready LED on startup
|
||||||
|
readyLedStatus = true;
|
||||||
digitalWrite(silenceLed, LOW);
|
digitalWrite(silenceLed, LOW);
|
||||||
digitalWrite(alarmLed, LOW);
|
digitalWrite(alarmLed, LOW);
|
||||||
digitalWrite(smokeDetectorRelay, LOW); //turn on smoke relay
|
digitalWrite(smokeDetectorRelay, LOW); //turn on smoke relay
|
||||||
|
lastPulse = millis(); //start last pulse
|
||||||
Serial.println("-=- STARTUP COMPLETE -=-");
|
Serial.println("-=- STARTUP COMPLETE -=-");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -397,8 +412,8 @@ void checkKey(){
|
|||||||
if (digitalRead(keySwitchPin) == HIGH){
|
if (digitalRead(keySwitchPin) == HIGH){
|
||||||
if (keyInserted == false and keyRequired == true){
|
if (keyInserted == false and keyRequired == true){
|
||||||
currentScreen=-1;
|
currentScreen=-1;
|
||||||
|
keyInserted = true;
|
||||||
}
|
}
|
||||||
keyInserted = true;
|
|
||||||
} else {
|
} else {
|
||||||
if (keyInserted == true and keyRequired == true){
|
if (keyInserted == true and keyRequired == true){
|
||||||
currentScreen=-1;
|
currentScreen=-1;
|
||||||
@ -447,7 +462,7 @@ void checkDevices(){
|
|||||||
if (analogRead(zone1Pin) == 0){// or analogRead(zone2Pin) == 0){
|
if (analogRead(zone1Pin) == 0){// or analogRead(zone2Pin) == 0){
|
||||||
walkTestCount++;
|
walkTestCount++;
|
||||||
walkTestSmokeDetectorTimer = 0;
|
walkTestSmokeDetectorTimer = 0;
|
||||||
while (analogRead(zone1Pin) == 0) {// or analogRead(zone2Pin) <= resistorLenience) {
|
while (analogRead(zone1Pin) == 0) {// or analogRead(zone2Pin) <= resistorLenience) { --------------------------------- SOMEHOW FIX THIS, terribly designed devices that add voltage into the system can screw this up
|
||||||
digitalWrite(strobeRelay, LOW);
|
digitalWrite(strobeRelay, LOW);
|
||||||
if (silentWalkTest == false){
|
if (silentWalkTest == false){
|
||||||
digitalWrite(hornRelay, LOW);
|
digitalWrite(hornRelay, LOW);
|
||||||
@ -473,10 +488,10 @@ void checkDevices(){
|
|||||||
if (definiteAlarm == true or (isVerification == false and analogRead(zone1Pin) == 0 and horn != true and silenced==false)){ //activate the horns and strobes after verification
|
if (definiteAlarm == true or (isVerification == false and analogRead(zone1Pin) == 0 and horn != true and silenced==false)){ //activate the horns and strobes after verification
|
||||||
activateNAC();
|
activateNAC();
|
||||||
definiteAlarm = false;
|
definiteAlarm = false;
|
||||||
} else if ((analogRead(zone1Pin) >= 3000 or analogRead(zone2Pin) >= 3000) and eolResistor == true and troubleTimer >= 200) {
|
} else if ((analogRead(zone1Pin) == 4095 or analogRead(zone2Pin) == 4095) and eolResistor == true and troubleTimer >= 200) {
|
||||||
trouble = true;
|
trouble = true;
|
||||||
troubleType=1;
|
troubleType=1;
|
||||||
} else if ((analogRead(zone1Pin) >= 3000 or analogRead(zone2Pin) >= 3000) and eolResistor == true and troubleTimer <= 200){
|
} else if ((analogRead(zone1Pin) == 4095 or analogRead(zone2Pin) == 4095) and eolResistor == true and troubleTimer <= 200){
|
||||||
troubleTimer++;
|
troubleTimer++;
|
||||||
} else {
|
} else {
|
||||||
troubleTimer = 0;
|
troubleTimer = 0;
|
||||||
@ -485,26 +500,32 @@ void checkDevices(){
|
|||||||
//----------------------------------------------------------------------------- CHECK ACTIVATION DEVICES
|
//----------------------------------------------------------------------------- CHECK ACTIVATION DEVICES
|
||||||
|
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------- TROUBLE RESPONSE
|
||||||
void troubleCheck(){
|
void troubleCheck(){
|
||||||
if (trouble == true){
|
if (trouble == true){
|
||||||
if (troubleLedTimer == 0){
|
if (troubleLedTimer >= 200){
|
||||||
digitalWrite(readyLed, LOW);
|
if (readyLedStatus == true){
|
||||||
if (troubleAck == false and fullAlarm == false){
|
digitalWrite(readyLed, LOW);
|
||||||
noTone();
|
readyLedStatus = false;
|
||||||
|
if (troubleAck==false){
|
||||||
|
noTone();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
digitalWrite(readyLed, HIGH);
|
||||||
|
readyLedStatus = true;
|
||||||
|
if (troubleAck==false){
|
||||||
|
tone();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if (troubleLedTimer == 750){
|
troubleLedTimer = 0;
|
||||||
digitalWrite(readyLed, HIGH);
|
} else {
|
||||||
if (troubleAck == false and fullAlarm == false){ //sound the buzzer if the trouble is not acked
|
troubleLedTimer++;
|
||||||
tone();
|
|
||||||
}
|
|
||||||
} else if (troubleLedTimer == 1500){
|
|
||||||
troubleLedTimer = -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
troubleLedTimer++;
|
|
||||||
} else {
|
} else {
|
||||||
if (walkTest == false){
|
if (walkTest == false){
|
||||||
digitalWrite(readyLed, HIGH);
|
digitalWrite(readyLed, HIGH);
|
||||||
|
readyLedStatus = true;
|
||||||
}
|
}
|
||||||
if (troubleLedTimer != 0){
|
if (troubleLedTimer != 0){
|
||||||
noTone();
|
noTone();
|
||||||
@ -512,7 +533,10 @@ void troubleCheck(){
|
|||||||
troubleLedTimer=0;
|
troubleLedTimer=0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//----------------------------------------------------------------------------- TROUBLE RESPONSE
|
||||||
|
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------- RESET CODE
|
||||||
void reboot(){
|
void reboot(){
|
||||||
lcd.clear();
|
lcd.clear();
|
||||||
lcd.setCursor(2,0);
|
lcd.setCursor(2,0);
|
||||||
@ -532,7 +556,10 @@ void reboot(){
|
|||||||
digitalWrite(alarmLed, LOW); //alarm LED
|
digitalWrite(alarmLed, LOW); //alarm LED
|
||||||
ESP.restart();
|
ESP.restart();
|
||||||
}
|
}
|
||||||
|
//----------------------------------------------------------------------------- RESET CODE
|
||||||
|
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------- BUTTON CHECK
|
||||||
void checkButtons(){
|
void checkButtons(){
|
||||||
if (digitalRead(resetButtonPin) == HIGH){ //RESET BUTTON
|
if (digitalRead(resetButtonPin) == HIGH){ //RESET BUTTON
|
||||||
reboot();
|
reboot();
|
||||||
@ -581,6 +608,8 @@ void checkButtons(){
|
|||||||
drillPressed = false;
|
drillPressed = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//----------------------------------------------------------------------------- BUTTON CHECK
|
||||||
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------------- NAC ACTIVATION
|
//----------------------------------------------------------------------------- NAC ACTIVATION
|
||||||
void alarm(){
|
void alarm(){
|
||||||
@ -774,7 +803,7 @@ void config(){
|
|||||||
char *main[] = {"Testing","Settings"}; //menu 0
|
char *main[] = {"Testing","Settings"}; //menu 0
|
||||||
char *mainTesting[] = {"Walk Test","Silent Wlk Test","Strobe Test"}; //menu 1
|
char *mainTesting[] = {"Walk Test","Silent Wlk Test","Strobe Test"}; //menu 1
|
||||||
char *mainSettings[] = {"Fire Alarm","Panel"}; //menu 2
|
char *mainSettings[] = {"Fire Alarm","Panel"}; //menu 2
|
||||||
char *mainSettingsFireAlarmSettings[] = {"Coding","Verification","Pre-Alarm","Audible Sil.: "}; //menu 3
|
char *mainSettingsFireAlarmSettings[] = {"Coding","Verification","Pre-Alarm","Audible Sil.: ","Keyless Sil."}; //menu 3
|
||||||
char *mainSettingsVerificationSettings[] = {"Verification: ","Verif. Time"}; //menu 4
|
char *mainSettingsVerificationSettings[] = {"Verification: ","Verif. Time"}; //menu 4
|
||||||
char *mainSettingsFireAlarmSettingsCoding[] = {"Temporal Three","Marchtime","4-4","Continuous","California","Slow Marchtime"}; //menu 5
|
char *mainSettingsFireAlarmSettingsCoding[] = {"Temporal Three","Marchtime","4-4","Continuous","California","Slow Marchtime"}; //menu 5
|
||||||
char *mainSettingsFireAlarmSettingsPreAlarmSettings[] = {"Pre-Alarm: ","stage 1: ","Detector PreAlrm"}; //menu 6
|
char *mainSettingsFireAlarmSettingsPreAlarmSettings[] = {"Pre-Alarm: ","stage 1: ","Detector PreAlrm"}; //menu 6
|
||||||
@ -782,7 +811,7 @@ void config(){
|
|||||||
char *mainPanelSettings[] = {"Panel Name","Panel Security","LCD Dim:","Factory Reset","About","Calibration"}; //menu 8
|
char *mainPanelSettings[] = {"Panel Name","Panel Security","LCD Dim:","Factory Reset","About","Calibration"}; //menu 8
|
||||||
char *mainPanelSettingsPanelSecurity[] = {"None","Keyswitch","Passcode"}; //menu 9
|
char *mainPanelSettingsPanelSecurity[] = {"None","Keyswitch","Passcode"}; //menu 9
|
||||||
char *mainPanelSettingsPanelName[] = {"Enter Name:"}; //menu 10
|
char *mainPanelSettingsPanelName[] = {"Enter Name:"}; //menu 10
|
||||||
char *mainPanelSettingsAbout[] = {"ANTIGNEOUS OS","Firmware: ",firmwareRev,"by Lexzach"}; //menu 12
|
char *mainPanelSettingsAbout[] = {"Antigneous FACP","Firmware: ","by Lexzach"}; //menu 12
|
||||||
char *mainPanelSettingsCalibrate[] = {"Activated Zone 1", "Normal Zone 1", "Trouble Zone 1", "Activated Zone 2", "Normal Zone 2", "Trouble Zone 2"}; //menu 13
|
char *mainPanelSettingsCalibrate[] = {"Activated Zone 1", "Normal Zone 1", "Trouble Zone 1", "Activated Zone 2", "Normal Zone 2", "Trouble Zone 2"}; //menu 13
|
||||||
|
|
||||||
|
|
||||||
@ -991,19 +1020,19 @@ void config(){
|
|||||||
configTop = (String)mainPanelSettings[1];
|
configTop = (String)mainPanelSettings[1];
|
||||||
if (lcdTimeout == 0){
|
if (lcdTimeout == 0){
|
||||||
configBottom = (String)mainPanelSettings[2] + "off";
|
configBottom = (String)mainPanelSettings[2] + "off";
|
||||||
} else if (lcdTimeout<6000) {
|
} else if (lcdTimeout<=30000) {
|
||||||
configBottom = (String)mainPanelSettings[2] + lcdTimeout/20+"s";
|
configBottom = (String)mainPanelSettings[2] + lcdTimeout/1000+"s";
|
||||||
} else {
|
} else {
|
||||||
configBottom = (String)mainPanelSettings[2] + lcdTimeout/1200+"m";
|
configBottom = (String)mainPanelSettings[2] + lcdTimeout/60000+"m";
|
||||||
}
|
}
|
||||||
} else if (cursorPosition == 1) {
|
} else if (cursorPosition == 1) {
|
||||||
cursorPosition = 2;
|
cursorPosition = 2;
|
||||||
if (lcdTimeout == 0){
|
if (lcdTimeout == 0){
|
||||||
configTop = (String)mainPanelSettings[2] + "off";
|
configTop = (String)mainPanelSettings[2] + "off";
|
||||||
} else if (lcdTimeout<6000) {
|
} else if (lcdTimeout<=30000) {
|
||||||
configTop = (String)mainPanelSettings[2] + lcdTimeout/20+"s";
|
configTop = (String)mainPanelSettings[2] + lcdTimeout/1000+"s";
|
||||||
} else {
|
} else {
|
||||||
configTop = (String)mainPanelSettings[2] + lcdTimeout/1200+"m";
|
configTop = (String)mainPanelSettings[2] + lcdTimeout/60000+"m";
|
||||||
}
|
}
|
||||||
configBottom = (String)mainPanelSettings[3];
|
configBottom = (String)mainPanelSettings[3];
|
||||||
|
|
||||||
@ -1049,38 +1078,41 @@ void config(){
|
|||||||
}
|
}
|
||||||
} else if (cursorPosition == 2) {
|
} else if (cursorPosition == 2) {
|
||||||
if (lcdTimeout == 0){
|
if (lcdTimeout == 0){
|
||||||
lcdTimeout = 300;
|
lcdTimeout = 15000;
|
||||||
EEPROM.write(80,1);
|
EEPROM.write(80,1);
|
||||||
} else if (lcdTimeout == 300){
|
} else if (lcdTimeout == 15000){
|
||||||
lcdTimeout = 600;
|
lcdTimeout = 30000;
|
||||||
EEPROM.write(80,2);
|
EEPROM.write(80,2);
|
||||||
} else if (lcdTimeout == 600){
|
} else if (lcdTimeout == 30000){
|
||||||
lcdTimeout = 1200;
|
lcdTimeout = 60000;
|
||||||
EEPROM.write(80,4);
|
EEPROM.write(80,4);
|
||||||
} else if (lcdTimeout == 1200){
|
} else if (lcdTimeout == 60000){
|
||||||
lcdTimeout = 6000;
|
lcdTimeout = 300000;
|
||||||
EEPROM.write(80,20);
|
EEPROM.write(80,20);
|
||||||
} else if (lcdTimeout == 6000){
|
} else if (lcdTimeout == 300000){
|
||||||
lcdTimeout = 12000;
|
lcdTimeout = 600000;
|
||||||
EEPROM.write(80,40);
|
EEPROM.write(80,40);
|
||||||
} else if (lcdTimeout >= 12000){
|
} else if (lcdTimeout >= 600000){
|
||||||
lcdTimeout = 0;
|
lcdTimeout = 0;
|
||||||
EEPROM.write(80,0);
|
EEPROM.write(80,0);
|
||||||
}
|
}
|
||||||
EEPROM.commit();
|
EEPROM.commit();
|
||||||
if (lcdTimeout == 0){
|
if (lcdTimeout == 0){
|
||||||
configTop = (String)mainPanelSettings[2] + "off";
|
configTop = (String)mainPanelSettings[2] + "off";
|
||||||
} else if (lcdTimeout<6000) {
|
} else if (lcdTimeout<=30000) {
|
||||||
configTop = (String)mainPanelSettings[2] + lcdTimeout/20+"s";
|
configTop = (String)mainPanelSettings[2] + lcdTimeout/1000+"s";
|
||||||
} else {
|
} else {
|
||||||
configTop = (String)mainPanelSettings[2] + lcdTimeout/1200+"m";
|
configTop = (String)mainPanelSettings[2] + lcdTimeout/60000+"m";
|
||||||
}
|
}
|
||||||
} else if (cursorPosition == 3){
|
} else if (cursorPosition == 3){
|
||||||
configBottom = "drill = yes";
|
configBottom = "drill = yes";
|
||||||
configTop = "silence = no";
|
configTop = "silence = no";
|
||||||
configPage = -1;
|
configPage = -1;
|
||||||
} else if (cursorPosition == 4){
|
} else if (cursorPosition == 4){
|
||||||
//firmware version
|
configPage = 12;
|
||||||
|
cursorPosition = 0;
|
||||||
|
configTop = (String)mainPanelSettingsAbout[0];
|
||||||
|
configBottom = (String)mainPanelSettingsAbout[1]+firmwareRev;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//----------------------------------------------------------------------------- SETTINGS > PANEL
|
//----------------------------------------------------------------------------- SETTINGS > PANEL
|
||||||
@ -1103,7 +1135,7 @@ void config(){
|
|||||||
}
|
}
|
||||||
} else if (resetPressed==true and resetStillPressed==true) {
|
} else if (resetPressed==true and resetStillPressed==true) {
|
||||||
clearTimer++;
|
clearTimer++;
|
||||||
if (clearTimer >= 1000) {
|
if (clearTimer >= 35) { //clear character if held down
|
||||||
panelNameList[cursorPosition] = 32;
|
panelNameList[cursorPosition] = 32;
|
||||||
}
|
}
|
||||||
} else if (silencePressed == true and silenceStillPressed == false){
|
} else if (silencePressed == true and silenceStillPressed == false){
|
||||||
@ -1295,7 +1327,7 @@ void config(){
|
|||||||
//----------------------------------------------------------------------------- SETTINGS > FIRE ALARM > VERIFICATION
|
//----------------------------------------------------------------------------- SETTINGS > FIRE ALARM > VERIFICATION
|
||||||
|
|
||||||
//----------------------------------------------------------------------------- SETTINGS > PANEL > PANEL SECURITY
|
//----------------------------------------------------------------------------- SETTINGS > PANEL > PANEL SECURITY
|
||||||
} else if (configPage == 9){
|
} else if (configPage == 9){
|
||||||
if (resetPressed == true and resetStillPressed == false){
|
if (resetPressed == true and resetStillPressed == false){
|
||||||
if (cursorPosition == 0){
|
if (cursorPosition == 0){
|
||||||
cursorPosition = 1;
|
cursorPosition = 1;
|
||||||
@ -1335,8 +1367,32 @@ void config(){
|
|||||||
configTop = (String)mainPanelSettingsPanelSecurity[1]+"*";
|
configTop = (String)mainPanelSettingsPanelSecurity[1]+"*";
|
||||||
configBottom = (String)mainPanelSettingsPanelSecurity[0];
|
configBottom = (String)mainPanelSettingsPanelSecurity[0];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
//----------------------------------------------------------------------------- SETTINGS > PANEL > PANEL SECURITY
|
||||||
|
} else if (configPage == 12){
|
||||||
|
if (resetPressed == true and resetStillPressed == false){
|
||||||
|
if (cursorPosition == 0){
|
||||||
|
cursorPosition = 1;
|
||||||
|
configTop = (String)mainPanelSettingsAbout[1]+firmwareRev;
|
||||||
|
configBottom = (String)mainPanelSettingsAbout[2];
|
||||||
|
} else if (cursorPosition == 1) {
|
||||||
|
cursorPosition = 2;
|
||||||
|
configTop = (String)mainPanelSettingsAbout[2];
|
||||||
|
configBottom = (String)mainPanelSettingsAbout[0];
|
||||||
|
} else if (cursorPosition == 2) {
|
||||||
|
cursorPosition = 0;
|
||||||
|
configTop = (String)mainPanelSettingsAbout[0];
|
||||||
|
configBottom = (String)mainPanelSettingsAbout[1]+firmwareRev;
|
||||||
|
}
|
||||||
|
} else if (silencePressed == true and silenceStillPressed == false){
|
||||||
|
configPage = 8;
|
||||||
|
cursorPosition = 0;
|
||||||
|
configTop = (String)mainPanelSettings[0];
|
||||||
|
configBottom = (String)mainPanelSettings[1];
|
||||||
|
}
|
||||||
|
//----------------------------------------------------------------------------- SETTINGS > PANEL > ABOUT
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// if (resetPressed == true and resetStillPressed == false){
|
// if (resetPressed == true and resetStillPressed == false){
|
||||||
@ -1351,7 +1407,12 @@ void config(){
|
|||||||
lcd.clear();
|
lcd.clear();
|
||||||
lcd.setCursor(0,0);
|
lcd.setCursor(0,0);
|
||||||
if (configPage != -1){
|
if (configPage != -1){
|
||||||
lcd.print("]" + configTop);
|
// if (configTop.indexOf("*")>0){ //replace any "*" with nothing, then add a check mark to the end
|
||||||
|
// lcd.print("]" + configTop.replace("*",""));
|
||||||
|
|
||||||
|
// } else { //---------------------------------------------------------------------------------------- experimental code for check
|
||||||
|
lcd.print("]" + configTop);
|
||||||
|
//}
|
||||||
} else {
|
} else {
|
||||||
lcd.print(configTop);
|
lcd.print(configTop);
|
||||||
}
|
}
|
||||||
@ -1397,51 +1458,54 @@ void lcdBacklight(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
void loop() {
|
void loop() {
|
||||||
delay(1); //-------------------- SYSTEM CLOCK
|
systemClock = millis(); //-------------------- SYSTEM CLOCK
|
||||||
|
if (systemClock-lastPulse >= 1){
|
||||||
|
//------------------------------------------------------ CHECK LCD BACKLIGHT
|
||||||
|
|
||||||
//------------------------------------------------------ CHECK LCD BACKLIGHT
|
|
||||||
if (lcdCheckTimer >= 50){
|
|
||||||
lcdBacklight();
|
lcdBacklight();
|
||||||
lcdCheckTimer = 0;
|
|
||||||
} else {
|
|
||||||
lcdCheckTimer++;
|
|
||||||
}
|
|
||||||
//------------------------------------------------------ CHECK LCD BACKLIGHT
|
|
||||||
|
|
||||||
//------------------------------------------------------ CHECK KEY
|
//------------------------------------------------------ CHECK LCD BACKLIGHT
|
||||||
if (keyCheckTimer >= 10){
|
|
||||||
|
//------------------------------------------------------ CHECK KEY
|
||||||
checkKey();
|
checkKey();
|
||||||
keyCheckTimer = 0;
|
//------------------------------------------------------ CHECK KEY
|
||||||
} else {
|
|
||||||
keyCheckTimer++;
|
|
||||||
}
|
|
||||||
//------------------------------------------------------ CHECK KEY
|
|
||||||
|
|
||||||
//------------------------------------------------------ CHECK ACTIVATING DEVICES
|
//------------------------------------------------------ CHECK ACTIVATING DEVICES
|
||||||
if (deviceCheckTimer >= 10){
|
|
||||||
checkDevices(); //check pull stations and smoke detectors
|
|
||||||
deviceCheckTimer = 0;
|
|
||||||
} else {
|
|
||||||
deviceCheckTimer++;
|
|
||||||
}
|
|
||||||
//------------------------------------------------------ CHECK ACTIVATING DEVICES
|
|
||||||
|
|
||||||
troubleCheck(); //trouble check
|
checkDevices();
|
||||||
|
|
||||||
alarm(); //alarm codewheel
|
//------------------------------------------------------ CHECK ACTIVATING DEVICES
|
||||||
|
|
||||||
//------------------------------------------------------ CHECK BUTTONS
|
troubleCheck(); //trouble check
|
||||||
if (((keyInserted == true and keyRequired == true) or (keyInserted==false and keyRequired==false)) and configMenu == false){
|
|
||||||
checkButtons(); //check if certain buttons are pressed
|
alarm(); //alarm codewheel
|
||||||
}
|
|
||||||
if (configMenu==false){
|
//------------------------------------------------------ CHECK BUTTONS
|
||||||
lcdUpdate();
|
if (((keyInserted == true and keyRequired == true) or (keyInserted==false and keyRequired==false)) and configMenu == false){
|
||||||
} else if (configMenu==true) {
|
checkButtons(); //check if certain buttons are pressed
|
||||||
if ((keyInserted == true and keyRequired == true) or (keyInserted==false and keyRequired==false)){
|
|
||||||
config();
|
|
||||||
}
|
}
|
||||||
|
//------------------------------------------------------ CHECK BUTTONS
|
||||||
|
|
||||||
|
|
||||||
|
//------------------------------------------------------ UPDATE LCD DISPLAY
|
||||||
|
|
||||||
|
if (buttonCheckTimer >= 20){
|
||||||
|
if (configMenu==false){
|
||||||
|
lcdUpdate();
|
||||||
|
} else if (configMenu==true) {
|
||||||
|
if ((keyInserted == true and keyRequired == true) or (keyInserted==false and keyRequired==false)){
|
||||||
|
config();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
buttonCheckTimer = 0;
|
||||||
|
} else {
|
||||||
|
buttonCheckTimer++;
|
||||||
|
}
|
||||||
|
|
||||||
|
//------------------------------------------------------ UPDATE LCD DISPLAY
|
||||||
|
|
||||||
|
lastPulse = millis(); //update last pulse
|
||||||
}
|
}
|
||||||
//------------------------------------------------------ CHECK BUTTONS
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
1
instructions/.~lock.antigneous_tech_instructions.odt#
Normal file
1
instructions/.~lock.antigneous_tech_instructions.odt#
Normal file
@ -0,0 +1 @@
|
|||||||
|
,lexzach,GLaDOS,27.09.2022 19:20,file:///home/lexzach/.config/libreoffice/4;
|
Loading…
x
Reference in New Issue
Block a user