You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// A6-A7 are analog-only pins that aren't quite as responsive and require a physical pullup resistor (1K to +5V), and can't be used with rotary encoders because they don't support pin change interrupts.
38
38
39
39
// What input is associated with each control?
40
-
const byte mainSel = A1; //main select button - must be equipped
41
-
const byte mainAdjUp = A3; //main up/down buttons or rotary encoder - must be equipped
42
-
const byte mainAdjDn = A2;
40
+
const byte mainSel = A2; //main select button - must be equipped
41
+
const byte mainAdjUp = A1; //main up/down buttons or rotary encoder - must be equipped
42
+
const byte mainAdjDn = A0;
43
43
const byte altSel = 0; //alt select button - if unequipped, set to 0
44
44
const byte altAdjUp = 0; //A6; //alt up/down buttons or rotary encoder - if unequipped, set to 0
45
45
const byte altAdjDn = 0; //A3;
@@ -92,8 +92,8 @@ const word cleanSpeed = 200; //ms
92
92
const word scrollSpeed = 100; //ms - e.g. scroll-in-and-out date at :30 - to give the illusion of a slow scroll that doesn't pause, use (timeoutTempFn*1000)/(displaySize+1) - e.g. 714 for displaySize=6 and timeoutTempFn=5
93
93
94
94
// What are the timeouts for setting and temporarily-displayed functions? up to 65535 sec
95
-
constword timeoutSet = 120; //sec
96
-
constword timeoutTempFn = 5; //sec
95
+
constunsignedlong timeoutSet = 120; //sec
96
+
constunsignedlong timeoutTempFn = 5; //sec
97
97
98
98
99
99
////////// Other global consts and vars //////////
@@ -192,13 +192,16 @@ void setup(){
192
192
initOutputs();
193
193
initInputs();
194
194
//Initialize EEPROM if requested
195
-
//if(readInput(mainSel)==LOW) initEEPROM(); TODO why is this firing so much
195
+
if(readInput(mainSel)==LOW) initEEPROM(); //TODO why is this firing so much
196
196
//Some options need to be set to a fixed value per the hardware configuration
197
-
if(relayPin<0 || piezoPin<0) { //If no relay or no piezo, set each signal setting to [if no relay then beeper else relay]
197
+
if(relayPin<0 || piezoPin<0) { //If no relay or no piezo, set each signal setting to [if no relay then piezo else relay]
198
198
writeEEPROM(42,(relayPin<0?0:1),false); //alarm
199
199
writeEEPROM(43,(relayPin<0?0:1),false); //timer
200
200
writeEEPROM(44,(relayPin<0?0:1),false); //strike
201
201
}
202
+
if(piezoPin>=0 && relayMode==0) { //If piezo and relay is switch
203
+
writeEEPROM(44,0,false); //strike forced to piezo
204
+
}
202
205
if(piezoPin<0 && relayMode==0) { //If no piezo and relay is switch
203
206
writeEEPROM(21,0,false); //turn off strike
204
207
writeEEPROM(25,0,false); //turn off timer interval mode
0 commit comments