This commit is contained in:
Lexzach 2022-04-20 13:00:28 -04:00
parent 7463c83cae
commit 1161349f3f
5 changed files with 85 additions and 10 deletions

View File

@ -3,5 +3,8 @@
// for the documentation about the extensions.json format // for the documentation about the extensions.json format
"recommendations": [ "recommendations": [
"platformio.platformio-ide" "platformio.platformio-ide"
],
"unwantedRecommendations": [
"ms-vscode.cpptools-extension-pack"
] ]
} }

BIN
facp/src/ascii.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 533 KiB

View File

@ -1,7 +1,9 @@
Address allocation: Address allocation:
1-6 | "Lexzach" - verify that eeprom is the FACP config eeprom 1-6 | "Lexzach" - verify that eeprom is the FACP config eeprom
7 | 0-3 - coding selection 7 | 0-5 - coding selection
8 | 0-1 - is a key required 8 | 0-1 - is a key required
9 | 0-1 - is there verification 9 | 0-1 - is there verification
10 | 1-255 - how long to do verification (value * 0.1 = actual verification time in seconds) 10 | 1-255 - how long to do verification (value * 0.1 = actual verification time in seconds)
11-71 | 65-90, 97-122, 45-57, 32 - System name 11-71 | 65-90, 97-122, 45-57, 32 - System name
72 | 0-4094 - EOL resistor lenience
73 | 0-1 - enable EOL resistor

View File

@ -21,9 +21,10 @@ int currentScreen = 0; //update display if previous screen is not the same
//CONFIG VARIABLES //CONFIG VARIABLES
bool keyRequired = true; //determine if key switch is required to operate buttons bool keyRequired = true; //determine if key switch is required to operate buttons
bool isVerification = true; //is verification turned on bool isVerification = true; //is verification turned on
bool eolResistor = true; //is the EOL resistor enabled
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 = 2500;
int resistorLenience = 0;
LiquidCrystal_I2C lcd(0x27,16,2); LiquidCrystal_I2C lcd(0x27,16,2);
void setup() { void setup() {
@ -79,6 +80,15 @@ void setup() {
EEPROM.write(9,1); //verification is turned on by default EEPROM.write(9,1); //verification is turned on by default
EEPROM.write(10,25); //default verification time of 2.5 seconds EEPROM.write(10,25); //default verification time of 2.5 seconds
//system name "[DEFAULT NAME]"
EEPROM.write(11,91);EEPROM.write(12,68);EEPROM.write(13,69);EEPROM.write(14,70);EEPROM.write(15,65);EEPROM.write(16,85);EEPROM.write(17,76);EEPROM.write(18,84);EEPROM.write(19,32);EEPROM.write(20,78);EEPROM.write(21,65);EEPROM.write(22,77);EEPROM.write(23,69);EEPROM.write(24,93);
for (int i=25; i==71; i++){ //write all 0's from 25-71 address
EEPROM.write(i,0);
}
EEPROM.write(72,0); //EOL lenience 0 by default
EEPROM.write(73,1); //EOL resistor is enabled by default
EEPROM.commit(); EEPROM.commit();
} else { } else {
Serial.println("EEPROM verification finished"); Serial.println("EEPROM verification finished");
@ -104,8 +114,13 @@ void setup() {
} else { } else {
isVerification = false; isVerification = false;
} }
if (EEPROM.read(73) == 1){
eolResistor = true;
} else {
eolResistor = false;
}
verificationTime = EEPROM.read(10)*100; verificationTime = EEPROM.read(10)*100;
resistorLenience = EEPROM.read(72);
Serial.println("Config loaded"); Serial.println("Config loaded");
digitalWrite(27, HIGH); //power on ready LED on startup digitalWrite(27, HIGH); //power on ready LED on startup
} }
@ -131,7 +146,7 @@ void checkKey(){
void checkDevices(){ void checkDevices(){
if (analogRead(15) <= 500 and horn != true){ if (analogRead(15) <= resistorLenience and horn != true){
verification++; verification++;
} else { } else {
verification = 0; verification = 0;
@ -141,7 +156,7 @@ void checkDevices(){
strobe = true; strobe = true;
fullAlarm = true; fullAlarm = true;
tone(); tone();
} else if (analogRead(15) == 4095) { } else if (analogRead(15) == 4095 and eolResistor == true) {
trouble = true; trouble = true;
troubleType=1; troubleType=1;
} }
@ -181,12 +196,14 @@ void checkButtons(){
digitalWrite(26, HIGH); //silence LED digitalWrite(26, HIGH); //silence LED
digitalWrite(25, HIGH); //alarm LED digitalWrite(25, HIGH); //alarm LED
delay(1500); delay(1500);
noTone();
ESP.restart(); ESP.restart();
} }
if (digitalRead(35) == HIGH){ //SILENCE BUTTON if (digitalRead(35) == HIGH){ //SILENCE BUTTON
if (horn == true){ //if horns are not silenced, silence the horns if (horn == true){ //if horns are not silenced, silence the horns
digitalWrite(26, HIGH); digitalWrite(26, HIGH);
digitalWrite(25, LOW);
horn = false; horn = false;
} else if (horn == false and strobe == true){ //if the horns are silenced and the button is pressed again, silence the buzzer } else if (horn == false and strobe == true){ //if the horns are silenced and the button is pressed again, silence the buzzer
noTone(); noTone();
@ -200,6 +217,8 @@ void checkButtons(){
if (drill == 2000){ if (drill == 2000){
horn = true; horn = true;
strobe = true; strobe = true;
fullAlarm = true;
tone();
} else { } else {
drill++; drill++;
} }
@ -280,6 +299,24 @@ void alarm(){
} else if (codeWheel == 3) { //continuous } else if (codeWheel == 3) { //continuous
digitalWrite(13, LOW); digitalWrite(13, LOW);
} else if (codeWheel == 5) {
if (codeWheelTimer == 0){ //marchtime slower
digitalWrite(13, LOW);
} else if (codeWheelTimer == 500){
digitalWrite(13, HIGH);
} else if (codeWheelTimer == 1000){
codeWheelTimer = -1;
}
} else if (codeWheel == 4) {
if (codeWheelTimer == 0){ //california code
digitalWrite(13, LOW);
} else if (codeWheelTimer == 10000){
digitalWrite(13, HIGH);
} else if (codeWheelTimer == 5000){
codeWheelTimer = -1;
}
} }
codeWheelTimer++; codeWheelTimer++;
@ -317,15 +354,15 @@ void lcdUpdate(){
lcd.clear(); lcd.clear();
lcd.setCursor(1,0); lcd.setCursor(1,0);
lcd.print("*** Trouble ***"); lcd.print("*** Trouble ***");
lcd.setCursor(2,1); lcd.setCursor(2,0);
lcd.print("Ground Fault"); lcd.print("Device removed or EOL resistor not installed");
currentScreen = 2; currentScreen = 2;
} else if (fullAlarm == true and currentScreen != 3){ } else if (fullAlarm == true and currentScreen != 3){
lcd.clear(); lcd.clear();
lcd.setCursor(0,0); lcd.setCursor(0,0);
lcd.print("*** FIRE ALARM ***"); lcd.print("*** FIRE ALARM ***");
lcd.setCursor(2,1); lcd.setCursor(2,1);
lcd.print("zone info here"); lcd.print("Zone 1");
currentScreen = 3; currentScreen = 3;
} }
} }
@ -345,7 +382,7 @@ void loop() {
} else { } else {
lcdUpdateTimer++; lcdUpdateTimer++;
} }
Serial.println(digitalRead(35)); Serial.println(analogRead(15));
} }

33
facp/src/menus.txt Normal file
View File

@ -0,0 +1,33 @@
[testing]
- walk test
- strobe test
- full system test
[settings]
- [fire alarm settings]
- - [coding]
- - - Temporal 3 = 0
- - - Marchtime = 1
- - - 4-4 = 2
- - - Continuious = 3
- - - California = 4
- - - Marchtime (slower) = 5
- - verification
- - verification time
- - audible silence
- - advanced smoke detector verification
- - smoke detector verification timeout
- [panel settings]
- - [panel name]
- - - enter panel name
- - [homescreen]
- - - panel name
- - - [stats for nerds]
- - - - zone input voltages
- - lcd timeout
[advanced settings]
- [resistor lenience]
- - 0-200
- [EOL resistors]
- - enabled
- - disabled