epic
This commit is contained in:
parent
1161349f3f
commit
809e60314e
@ -7,3 +7,8 @@ Address allocation:
|
|||||||
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
|
72 | 0-4094 - EOL resistor lenience
|
||||||
73 | 0-1 - enable EOL resistor
|
73 | 0-1 - enable EOL resistor
|
||||||
|
74 | 0-1 - pre-alarm enabled
|
||||||
|
75 | 1-10 - first-stage time
|
||||||
|
76 | 0-1 - smoke detector pre-alarm
|
||||||
|
77 | 1-5 - smoke detector timeout
|
||||||
|
78 | 0-1 - panel homescreen
|
@ -1,6 +1,7 @@
|
|||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
#include <EEPROM.h>
|
#include <EEPROM.h>
|
||||||
#include <LiquidCrystal_I2C.h>
|
#include <LiquidCrystal_I2C.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
//RUNTIME VARIABLES
|
//RUNTIME VARIABLES
|
||||||
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
|
||||||
@ -25,6 +26,8 @@ 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;
|
int resistorLenience = 0;
|
||||||
|
int panelHomescreen = 0;
|
||||||
|
String panelName = "";
|
||||||
LiquidCrystal_I2C lcd(0x27,16,2);
|
LiquidCrystal_I2C lcd(0x27,16,2);
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
@ -33,17 +36,20 @@ void setup() {
|
|||||||
Serial.println("Booting...");
|
Serial.println("Booting...");
|
||||||
|
|
||||||
pinMode(13, OUTPUT); //horn
|
pinMode(13, OUTPUT); //horn
|
||||||
pinMode(12, OUTPUT); //strobe
|
pinMode(18, OUTPUT); //strobe
|
||||||
pinMode(14, OUTPUT); //smoke relay
|
pinMode(14, OUTPUT); //smoke relay
|
||||||
pinMode(27, OUTPUT); //ready LED
|
pinMode(27, OUTPUT); //ready LED D
|
||||||
pinMode(26, OUTPUT); //silence LED
|
pinMode(26, OUTPUT); //silence LED D
|
||||||
pinMode(25, OUTPUT); //alarm LED
|
pinMode(25, OUTPUT); //alarm LED D
|
||||||
pinMode(33, INPUT); //key switch
|
pinMode(33, INPUT); //key switch D
|
||||||
pinMode(32, INPUT); //reset switch
|
pinMode(32, INPUT); //reset switch D
|
||||||
pinMode(35, INPUT); //silence switch
|
pinMode(35, INPUT); //silence switch D
|
||||||
pinMode(34, INPUT); //drill switch
|
pinMode(34, INPUT); //drill switch D
|
||||||
pinMode(15, INPUT); //pull station
|
pinMode(15, INPUT); //pull station D
|
||||||
pinMode(4, OUTPUT); //buzzer
|
pinMode(4, OUTPUT); //buzzer D
|
||||||
|
digitalWrite(13, HIGH); //horn
|
||||||
|
digitalWrite(18, HIGH); //strobe
|
||||||
|
digitalWrite(14, HIGH); //smoke relay
|
||||||
|
|
||||||
pinMode(22, OUTPUT); //scl
|
pinMode(22, OUTPUT); //scl
|
||||||
pinMode(21, OUTPUT); //sda
|
pinMode(21, OUTPUT); //sda
|
||||||
@ -82,11 +88,17 @@ void setup() {
|
|||||||
|
|
||||||
//system name "[DEFAULT NAME]"
|
//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);
|
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
|
for (int i=25; i<=71; i++){ //write all 0's from 25-71 address
|
||||||
EEPROM.write(i,0);
|
EEPROM.write(i,0);
|
||||||
}
|
}
|
||||||
EEPROM.write(72,0); //EOL lenience 0 by default
|
EEPROM.write(72,0); //EOL lenience 0 by default
|
||||||
EEPROM.write(73,1); //EOL resistor is enabled by default
|
EEPROM.write(73,1); //EOL resistor is enabled by default
|
||||||
|
EEPROM.write(74,0); //pre-alarm disabled by default
|
||||||
|
EEPROM.write(75,1); //pre-alarm first-stage is 1 minute by default
|
||||||
|
EEPROM.write(76,0); //smoke detector pre-alarm is disable by default
|
||||||
|
EEPROM.write(77,1); //smoke detector timeout
|
||||||
|
EEPROM.write(78,0); //homescreen is panel name by default
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
EEPROM.commit();
|
EEPROM.commit();
|
||||||
@ -121,8 +133,19 @@ void setup() {
|
|||||||
}
|
}
|
||||||
verificationTime = EEPROM.read(10)*100;
|
verificationTime = EEPROM.read(10)*100;
|
||||||
resistorLenience = EEPROM.read(72);
|
resistorLenience = EEPROM.read(72);
|
||||||
|
panelHomescreen = EEPROM.read(78);
|
||||||
|
for (int i=11; i<=71; i++){ //read panel name
|
||||||
|
if (EEPROM.read(i) != 0){
|
||||||
|
panelName = panelName + (char)EEPROM.read(i);
|
||||||
|
}
|
||||||
|
Serial.println(panelName);
|
||||||
|
}
|
||||||
|
|
||||||
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
|
||||||
|
digitalWrite(26, LOW);
|
||||||
|
digitalWrite(25, LOW);
|
||||||
|
digitalWrite(14, LOW); //smoke relay
|
||||||
}
|
}
|
||||||
|
|
||||||
void tone() {
|
void tone() {
|
||||||
@ -191,11 +214,17 @@ void troubleCheck(){
|
|||||||
|
|
||||||
void checkButtons(){
|
void checkButtons(){
|
||||||
if (digitalRead(32) == HIGH){ //RESET BUTTON
|
if (digitalRead(32) == HIGH){ //RESET BUTTON
|
||||||
|
lcd.clear();
|
||||||
|
lcd.setCursor(0,0);
|
||||||
|
lcd.print("Resetting...");
|
||||||
tone();
|
tone();
|
||||||
digitalWrite(27, HIGH); //ready LED
|
digitalWrite(27, HIGH); //ready LED
|
||||||
digitalWrite(26, HIGH); //silence LED
|
digitalWrite(26, HIGH); //silence LED
|
||||||
digitalWrite(25, HIGH); //alarm LED
|
digitalWrite(25, HIGH); //alarm LED
|
||||||
delay(1500);
|
digitalWrite(13, HIGH); //horn
|
||||||
|
digitalWrite(18, HIGH); //strobe
|
||||||
|
digitalWrite(14, HIGH); //smoke relay
|
||||||
|
delay(2500);
|
||||||
noTone();
|
noTone();
|
||||||
ESP.restart();
|
ESP.restart();
|
||||||
}
|
}
|
||||||
@ -228,6 +257,11 @@ void checkButtons(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
void alarm(){
|
void alarm(){
|
||||||
|
if (strobe == true){
|
||||||
|
digitalWrite(18, LOW);
|
||||||
|
}else{
|
||||||
|
digitalWrite(18,HIGH);
|
||||||
|
}
|
||||||
if (horn == true){
|
if (horn == true){
|
||||||
if (codeWheel == 0){
|
if (codeWheel == 0){
|
||||||
|
|
||||||
@ -341,6 +375,12 @@ void lcdUpdate(){
|
|||||||
lcd.clear();
|
lcd.clear();
|
||||||
lcd.setCursor(2,0);
|
lcd.setCursor(2,0);
|
||||||
lcd.print("System Normal");
|
lcd.print("System Normal");
|
||||||
|
lcd.setCursor(0,1);
|
||||||
|
if (panelHomescreen == 0){
|
||||||
|
lcd.print(panelName);
|
||||||
|
} else if (panelHomescreen == 1){
|
||||||
|
lcd.print(analogRead(15));
|
||||||
|
}
|
||||||
currentScreen = 0;
|
currentScreen = 0;
|
||||||
} else if (trouble==true){
|
} else if (trouble==true){
|
||||||
if (troubleType == 0 and currentScreen != 1){
|
if (troubleType == 0 and currentScreen != 1){
|
||||||
@ -382,7 +422,7 @@ void loop() {
|
|||||||
} else {
|
} else {
|
||||||
lcdUpdateTimer++;
|
lcdUpdateTimer++;
|
||||||
}
|
}
|
||||||
Serial.println(analogRead(15));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -11,23 +11,36 @@
|
|||||||
- - - Continuious = 3
|
- - - Continuious = 3
|
||||||
- - - California = 4
|
- - - California = 4
|
||||||
- - - Marchtime (slower) = 5
|
- - - Marchtime (slower) = 5
|
||||||
- - verification
|
- - enable/disable verification
|
||||||
- - verification time
|
- - [verification time]
|
||||||
- - audible silence
|
- - - 0.1-25.5 seconds
|
||||||
- - advanced smoke detector verification
|
- - [pre-alarm]
|
||||||
- - smoke detector verification timeout
|
- - - enable/disable pre-alarm
|
||||||
|
- - - [first-stage]
|
||||||
|
- - - - [first-stage time]
|
||||||
|
- - - - - 1-10 minutes
|
||||||
|
- - - [second-stage]
|
||||||
|
- - - [smoke detector pre-alarm]
|
||||||
|
- - - - enable/disable smoke detector pre-alarm
|
||||||
|
- - - - [smoke detector timeout]
|
||||||
|
- - - - - 1-5 minutes
|
||||||
|
- - enable/disable audible silence
|
||||||
- [panel settings]
|
- [panel settings]
|
||||||
- - [panel name]
|
- - [panel name]
|
||||||
- - - enter panel name
|
- - - enter panel name
|
||||||
|
- - [panel security]
|
||||||
|
- - - None
|
||||||
|
- - - Keyswitch (pin 33)
|
||||||
|
- - - Passcode (future)
|
||||||
- - [homescreen]
|
- - [homescreen]
|
||||||
- - - panel name
|
- - - panel name
|
||||||
- - - [stats for nerds]
|
- - - [stats for nerds]
|
||||||
- - - - zone input voltages
|
- - - - zone input voltages
|
||||||
- - lcd timeout
|
- - - -
|
||||||
|
- - [lcd timeout]
|
||||||
|
- - - 30 sec, 1 min, 5 min, 30 min, off
|
||||||
[advanced settings]
|
[advanced settings]
|
||||||
- [resistor lenience]
|
- [resistor lenience]
|
||||||
- - 0-200
|
- - 0-200
|
||||||
- [EOL resistors]
|
- enable/disable EOL resistors
|
||||||
- - enabled
|
|
||||||
- - disabled
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user