Skip to content

Commit ee5db6d

Browse files
committed
terminology cleanup
functions are "functions" in code, but not described as such in operating instructions; night/away "shutoff" rather than "mode"; relay / setting / timer countdown are still modes
1 parent bb2065c commit ee5db6d

File tree

10 files changed

+47
-47
lines changed

10 files changed

+47
-47
lines changed

TODO.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Option to display weekdays as Sun=0 or Sun=1 (per Portuguese!)
66
* When setting times of day, make 1439 (minutes) roll over to 0 and vice versa
77
* Implement options for full date every 5 minutes
8-
* Is it possible to trip the chime *after* determining if we're in night mode or not
8+
* Is it possible to trip the chime *after* determining if we're in night shutoff or not
99
* Reenable rotary encoder with libraries with workable licenses
1010
* In display code, consider using `delayMicroseconds()` which, with its tighter resolution, may give better control over fades and dim levels
1111
* in `checkInputs()`, can all this if/else business be defined at load instead of evaluated every sample? OR is it compiled that way? maybe use `#ifdef`

arduino-nixie/arduino-nixie.ino

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ Some are skipped when they wouldn't apply to a given clock's hardware config, se
5959
24 Alarm snooze
6060
25 Timer interval mode - skipped when no piezo and relay is switch (start=0)
6161
26 LED circuit behavior - skipped when no led pin
62-
27 Night mode
62+
27 Night shutoff
6363
28-29 Night start, mins
6464
30-31 Night end, mins
65-
32 Away mode
65+
32 Away shutoff
6666
33 First day of workweek
6767
34 Last day of workweek
6868
35-36 Work starts at, mins
@@ -80,7 +80,7 @@ Some are skipped when they wouldn't apply to a given clock's hardware config, se
8080
//Options menu numbers (displayed in UI and readme), EEPROM locations, and default/min/max values.
8181
//Option numbers/order can be changed (though try to avoid for user convenience);
8282
//but option locs should be maintained so EEPROM doesn't have to be reset after an upgrade.
83-
// General Alarm Timer Strike Night and away mode Lat Long UTC±*
83+
// General Alarm Timer Strike Night and away shutoff Lat Long UTC±*
8484
const byte optsNum[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,11,12,13, 20,21,22, 30,31,32, 40, 41, 42,43,44,45, 46, 47, 50, 51, 52};
8585
const byte optsLoc[] = {16,17,18,19,20,22,26,46,45, 23,42,39,24, 25,43,40, 21,44,41, 27, 28, 30,32,33,34, 35, 37, 10, 12, 14};
8686
const int optsDef[] = { 2, 1, 0, 0, 5, 0, 1, 0, 0, 0, 0,61, 9, 0, 0,61, 0, 0,61, 0,1320, 360, 0, 1, 5, 480,1020, 0, 0,100};
@@ -130,7 +130,7 @@ word snoozeRemain = 0; //snooze timeout counter, seconds
130130
word timerInitial = 0; //timer original setting, seconds - up to 18 hours (64,800 seconds - fits just inside a word)
131131
word timerRemain = 0; //timer actual counter
132132
unsigned long signalPulseStartTime = 0; //to keep track of individual pulses so we can stop them
133-
word unoffRemain = 0; //un-off (briefly turn on tubes during full night or away modes) timeout counter, seconds
133+
word unoffRemain = 0; //un-off (briefly turn on tubes during full night/away shutoff) timeout counter, seconds
134134
byte displayDim = 2; //dim per display or function: 2=normal, 1=dim, 0=off
135135
byte cleanRemain = 0; //anti-cathode-poisoning clean timeout counter, increments at cleanSpeed ms (see loop()). Start at 11 to run at clock startup
136136
char scrollRemain = 0; //"frames" of scroll – 0=not scrolling, >0=coming in, <0=going out, -128=scroll out at next change
@@ -559,7 +559,7 @@ void doSetHold(bool start){
559559
//TODO integrate this with checkInputs?
560560
unsigned long now = millis();
561561
//The interval used to be 250, but in order to make the value change by a full 9 values between btnShortHold and btnLongHold,
562-
//the interval is now that difference divided by 9.5 (to try to ensure btnLongHold occurs comfortably between 9th and 10th doSet).
562+
//the interval is now that difference divided by 9. TODO divisor may need to be a bit higher in case btnLongHold ever fires before 9th.
563563
//It may be weird not being exactly quarter-seconds, but it doesn't line up with the blinking anyway.
564564
if(start || (unsigned long)(now-doSetHoldLast)>=((btnLongHold-btnShortHold)/9)) {
565565
doSetHoldLast = now;
@@ -674,14 +674,14 @@ void checkRTC(bool force){
674674
if(fnSetPg || fn>=fnOpts){
675675
if((unsigned long)(now-inputLast)>=timeoutSet*1000) { fnSetPg = 0; fn = fnIsTime; force=true; } //Time out after 2 mins
676676
}
677-
//Paged-display mode timeout //TODO change fnIsDate to consts? //TODO timeoutPageFn var
677+
//Paged-display function timeout //TODO change fnIsDate to consts? //TODO timeoutPageFn var
678678
else if(fn==fnIsDate && (unsigned long)(now-inputLast)>=2500) {
679679
//Here we just have to increment the page and decide when to reset. updateDisplay() will do the rendering
680680
fnPg++; inputLast+=2500; //but leave inputLastTODMins alone so the subsequent page displays will be based on the same TOD
681681
if(fnPg >= fnDatePages){ fnPg = 0; fn = fnIsTime; }
682682
force=true;
683683
}
684-
//Temporary-display mode timeout: if we're *not* in a permanent one (time, or running/signaling timer)
684+
//Temporary-display function timeout: if we're *not* in a permanent one (time, or running/signaling timer)
685685
else if(fn!=fnIsTime && !(fn==fnIsTimer && (timerRemain>0 || signalRemain>0))){ // && fn!=readEEPROM(7,false)
686686
if((unsigned long)(now-inputLast)>=timeoutTempFn*1000) { fnSetPg = 0; fn = fnIsTime; force=true; }
687687
}
@@ -728,8 +728,8 @@ void checkRTC(bool force){
728728
if(tod.second()<2 && displayDim==2 && fnSetPg==0 && unoffRemain==0) {
729729
switch(readEEPROM(46,false)) { //how often should the routine run?
730730
case 0: //every day
731-
if(readEEPROM(27,false)>0? //is night mode enabled?
732-
tod.second()==0 && tod.hour()*60+tod.minute()==readEEPROM(28,true): //if so, at start of night mode (at second :00 before dim is in effect)
731+
if(readEEPROM(27,false)>0? //is night shutoff enabled?
732+
tod.second()==0 && tod.hour()*60+tod.minute()==readEEPROM(28,true): //if so, at start of night shutoff (at second :00 before dim is in effect)
733733
tod.second()==1 && tod.hour()*60+tod.minute()==0) //if not, at 00:00:01
734734
cleanRemain = 51; //run routine for five cycles
735735
break;
@@ -809,7 +809,7 @@ void checkRTC(bool force){
809809
} //end natural second
810810

811811
//Finally, update the display, whether natural tick or not, as long as we're not setting or on a scrolled display (unless forced eg. fn change)
812-
//This also determines night/away mode, which is why strikes will happen if we go into off at top of hour, and not when we come into on at the top of the hour TODO find a way to fix this
812+
//This also determines night/away shutoff, which is why strikes will happen if we go into off at top of hour, and not when we come into on at the top of the hour TODO find a way to fix this
813813
//Also skip updating the display if this is date and not being forced, since its pages take some calculating that cause it to flicker
814814
if(fnSetPg==0 && (scrollRemain==0 || force) && !(fn==fnIsDate && !force)) updateDisplay();
815815

@@ -1064,7 +1064,7 @@ void updateDisplay(){
10641064
displayDim = (unoffRemain>0? 2: 0); //unoff overrides this
10651065
//clock at home: away on weekdays, during office hours only
10661066
else if( readEEPROM(32,false)==2 && isDayInRange(readEEPROM(33,false),readEEPROM(34,false),toddow) && isTimeInRange(readEEPROM(35,true), readEEPROM(37,true), todmins) ) displayDim = (unoffRemain>0? 2: 0);
1067-
//night mode - if night end is 0:00, use alarm time instead
1067+
//night shutoff - if night end is 0:00, use alarm time instead
10681068
else if( readEEPROM(27,false) && isTimeInRange(readEEPROM(28,true), (readEEPROM(30,true)==0?readEEPROM(0,true):readEEPROM(30,true)), todmins) ) displayDim = (readEEPROM(27,false)==1?1:(unoffRemain>0?2:0)); //dim or (unoff? bright: off)
10691069
//normal
10701070
else displayDim = 2;
@@ -1502,7 +1502,7 @@ void updateLEDs(){
15021502
ledStateTarget = 255;
15031503
//Serial.println(F("LEDs on always"));
15041504
break;
1505-
case 2: //on, but follow night/away modes
1505+
case 2: //on, but follow night/away shutoff
15061506
ledStateTarget = (displayDim==2? 255: (displayDim==1? 127: 0));
15071507
//Serial.print(displayDim==2? F("LEDs on"): (displayDim==1? F("LEDs dim"): F("LEDs off"))); Serial.println(F(" per dim state"));
15081508
break;

arduino-nixie/configs/v5-4tube.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const byte fnIsTemp = 4;
1111
const byte fnIsTubeTester = 5; //cycles all digits on all tubes 1/second, similar to anti-cathode-poisoning cleaner
1212
// functions enabled in this clock, in their display order. Only fnIsTime is required
1313
const byte fnsEnabled[] = {fnIsTime, fnIsDate, fnIsAlarm, fnIsTimer}; //, fnIsTemp, fnIsTubeTester
14-
// To control which of these display persistently vs. switch back to Time after a few seconds, search "Temporary-display mode timeout"
14+
// To control which of these display persistently vs. switch back to Time after a few seconds, search "Temporary-display function timeout"
1515

1616
// These are the UNDB v5 board connections to Arduino analog input pins.
1717
// S1/PL13 = Reset
@@ -55,11 +55,11 @@ const char ledPin = -1; //don't change - not available until UNDB v8
5555
const byte unoffDur = 10; //sec
5656

5757
// How long (in ms) are the button hold durations?
58-
const word btnShortHold = 1000; //for setting the displayed feataure
59-
const word btnLongHold = 3000; //for for entering options menu
58+
const word btnShortHold = 1000; //for entering setting mode, or hold-setting at low velocity
59+
const word btnLongHold = 3000; //for entering options menu, or hold-setting at high velocity
6060
const word velThreshold = 0; //ms
6161
// When an adj up/down input (btn or rot) follows another in less than this time, value will change more (10 vs 1).
62-
// 0 to disable. Recommend ~150 for rotaries. If you want to use this feature with buttons, extend to ~400.
62+
// 0 to disable. Recommend ~150 for rotaries. If you want to use this feature with buttons, extend to ~300.
6363

6464
// What is the "frame rate" of the tube cleaning and display scrolling? up to 65535 ms
6565
const word cleanSpeed = 200; //ms

arduino-nixie/configs/v5-6tube.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const byte fnIsTemp = 5;
1111
const byte fnIsTubeTester = 6; //cycles all digits on all tubes 1/second, similar to anti-cathode-poisoning cleaner
1212
// functions enabled in this clock, in their display order. Only fnIsTime is required
1313
const byte fnsEnabled[] = {fnIsTime, fnIsDate, fnIsAlarm, fnIsTimer}; //, fnIsTemp, fnIsTubeTester
14-
// To control which of these display persistently vs. switch back to Time after a few seconds, search "Temporary-display mode timeout"
14+
// To control which of these display persistently vs. switch back to Time after a few seconds, search "Temporary-display function timeout"
1515

1616
// These are the UNDB v5 board connections to Arduino analog input pins.
1717
// S1/PL13 = Reset
@@ -55,11 +55,11 @@ const char ledPin = -1; //don't change - not available until UNDB v8
5555
const byte unoffDur = 10; //sec
5656

5757
// How long (in ms) are the button hold durations?
58-
const word btnShortHold = 1000; //for setting the displayed feataure
59-
const word btnLongHold = 3000; //for for entering options menu
58+
const word btnShortHold = 1000; //for entering setting mode, or hold-setting at low velocity
59+
const word btnLongHold = 3000; //for entering options menu, or hold-setting at high velocity
6060
const word velThreshold = 0; //ms
6161
// When an adj up/down input (btn or rot) follows another in less than this time, value will change more (10 vs 1).
62-
// 0 to disable. Recommend ~150 for rotaries. If you want to use this feature with buttons, extend to ~400.
62+
// 0 to disable. Recommend ~150 for rotaries. If you want to use this feature with buttons, extend to ~300.
6363

6464
// What is the "frame rate" of the tube cleaning and display scrolling? up to 65535 ms
6565
const word cleanSpeed = 200; //ms

arduino-nixie/configs/v8-4tube.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const byte fnIsTemp = 4;
1111
const byte fnIsTubeTester = 5; //cycles all digits on all tubes 1/second, similar to anti-cathode-poisoning cleaner
1212
// functions enabled in this clock, in their display order. Only fnIsTime is required
1313
const byte fnsEnabled[] = {fnIsTime, fnIsDate, fnIsAlarm, fnIsTimer}; //, fnIsTemp, fnIsTubeTester
14-
// To control which of these display persistently vs. switch back to Time after a few seconds, search "Temporary-display mode timeout"
14+
// To control which of these display persistently vs. switch back to Time after a few seconds, search "Temporary-display function timeout"
1515

1616
// These are the RLB board connections to Arduino analog input pins.
1717
// S1/PL13 = Reset
@@ -61,11 +61,11 @@ const char ledPin = -1;
6161
const byte unoffDur = 10; //sec
6262

6363
// How long (in ms) are the button hold durations?
64-
const word btnShortHold = 1000; //for setting the displayed feataure
65-
const word btnLongHold = 3000; //for for entering options menu
64+
const word btnShortHold = 1000; //for entering setting mode, or hold-setting at low velocity
65+
const word btnLongHold = 3000; //for entering options menu, or hold-setting at high velocity
6666
const word velThreshold = 0; //ms
6767
// When an adj up/down input (btn or rot) follows another in less than this time, value will change more (10 vs 1).
68-
// 0 to disable. Recommend ~150 for rotaries. If you want to use this feature with buttons, extend to ~400.
68+
// 0 to disable. Recommend ~150 for rotaries. If you want to use this feature with buttons, extend to ~300.
6969

7070
// What is the "frame rate" of the tube cleaning and display scrolling? up to 65535 ms
7171
const word cleanSpeed = 200; //ms

arduino-nixie/configs/v8-6tube.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22

33
const byte displaySize = 6; //number of tubes in display module. Small display adjustments are made for 4-tube clocks
44

5-
// available clock modes, and unique IDs (between 0 and 200)
5+
// available clock functions, and unique IDs (between 0 and 200)
66
const byte fnIsTime = 0;
77
const byte fnIsDate = 1;
88
const byte fnIsAlarm = 2;
99
const byte fnIsTimer = 3;
1010
const byte fnIsTemp = 4;
1111
const byte fnIsTubeTester = 5; //cycles all digits on all tubes 1/second, similar to anti-cathode-poisoning cleaner
12-
// modes enabled in this clock, in their display order. Only fnIsTime is required
12+
// functions enabled in this clock, in their display order. Only fnIsTime is required
1313
const byte fnsEnabled[] = {fnIsTime, fnIsDate, fnIsAlarm, fnIsTimer}; //, fnIsTemp, fnIsTubeTester
14-
// To control which of these display persistently vs. switch back to Time after a few seconds, search "Temporary-display mode timeout"
14+
// To control which of these display persistently vs. switch back to Time after a few seconds, search "Temporary-display function timeout"
1515

1616
// These are the RLB board connections to Arduino analog input pins.
1717
// S1/PL13 = Reset
@@ -51,7 +51,7 @@ const byte enableSoftAlarmSwitch = 1;
5151
// 0 = no. Alarm will be permanently on. Use with switched relay if the appliance has its own switch on this relay circuit.
5252
const byte enableSoftPowerSwitch = 1; //works with switched relay only
5353
// 1 = yes. Relay can be switched on and off directly with Alt button at any time (except in options menu). This is useful if connecting an appliance (e.g. radio) that doesn't have its own switch, or if replacing the clock unit in a clock radio where the clock does all the switching (e.g. Telechron).
54-
// 0 = no. Use if the connected appliance has its own power switch (independent of this relay circuit) or does not need to be manually switched. In this case (and/or if there is no switched relay) Alt will act as a mode preset.
54+
// 0 = no. Use if the connected appliance has its own power switch (independent of this relay circuit) or does not need to be manually switched. In this case (and/or if there is no switched relay) Alt will act as a function preset.
5555

5656
//LED circuit control
5757
const char ledPin = -1;
@@ -61,17 +61,17 @@ const char ledPin = -1;
6161
const byte unoffDur = 10; //sec
6262

6363
// How long (in ms) are the button hold durations?
64-
const word btnShortHold = 1000; //for setting the displayed feataure
65-
const word btnLongHold = 3000; //for for entering options menu
64+
const word btnShortHold = 1000; //for entering setting mode, or hold-setting at low velocity
65+
const word btnLongHold = 3000; //for entering options menu, or hold-setting at high velocity
6666
const word velThreshold = 0; //ms
6767
// When an adj up/down input (btn or rot) follows another in less than this time, value will change more (10 vs 1).
68-
// 0 to disable. Recommend ~150 for rotaries. If you want to use this feature with buttons, extend to ~400.
68+
// 0 to disable. Recommend ~150 for rotaries. If you want to use this feature with buttons, extend to ~300.
6969

7070
// What is the "frame rate" of the tube cleaning and display scrolling? up to 65535 ms
7171
const word cleanSpeed = 200; //ms
7272
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
7373

74-
// What are the timeouts for setting and temporarily-displayed modes? up to 65535 sec
74+
// What are the timeouts for setting and temporarily-displayed functions? up to 65535 sec
7575
const unsigned long timeoutSet = 120; //sec
7676
const unsigned long timeoutTempFn = 5; //sec
7777

arduino-nixie/configs/v8c-6tube-relay.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const byte fnIsTemp = 4;
1111
const byte fnIsTubeTester = 5; //cycles all digits on all tubes 1/second, similar to anti-cathode-poisoning cleaner
1212
// functions enabled in this clock, in their display order. Only fnIsTime is required
1313
const byte fnsEnabled[] = {fnIsTime, fnIsDate, fnIsAlarm, fnIsTimer}; //, fnIsTemp, fnIsTubeTester
14-
// To control which of these display persistently vs. switch back to Time after a few seconds, search "Temporary-display mode timeout"
14+
// To control which of these display persistently vs. switch back to Time after a few seconds, search "Temporary-display function timeout"
1515

1616
// These are the RLB board connections to Arduino analog input pins.
1717
// S1/PL13 = Reset
@@ -61,11 +61,11 @@ const char ledPin = 9;
6161
const byte unoffDur = 10; //sec
6262

6363
// How long (in ms) are the button hold durations?
64-
const word btnShortHold = 1000; //for setting the displayed feataure
65-
const word btnLongHold = 3000; //for for entering options menu
64+
const word btnShortHold = 1000; //for entering setting mode, or hold-setting at low velocity
65+
const word btnLongHold = 3000; //for entering options menu, or hold-setting at high velocity
6666
const word velThreshold = 0; //ms
6767
// When an adj up/down input (btn or rot) follows another in less than this time, value will change more (10 vs 1).
68-
// 0 to disable. Recommend ~150 for rotaries. If you want to use this feature with buttons, extend to ~400.
68+
// 0 to disable. Recommend ~150 for rotaries. If you want to use this feature with buttons, extend to ~300.
6969

7070
// What is the "frame rate" of the tube cleaning and display scrolling? up to 65535 ms
7171
const word cleanSpeed = 200; //ms

arduino-nixie/configs/v8c-6tube-top-relay.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const byte fnIsTemp = 4;
1111
const byte fnIsTubeTester = 5; //cycles all digits on all tubes 1/second, similar to anti-cathode-poisoning cleaner
1212
// functions enabled in this clock, in their display order. Only fnIsTime is required
1313
const byte fnsEnabled[] = {fnIsTime, fnIsDate, fnIsAlarm, fnIsTimer}; //, fnIsTemp, fnIsTubeTester
14-
// To control which of these display persistently vs. switch back to Time after a few seconds, search "Temporary-display mode timeout"
14+
// To control which of these display persistently vs. switch back to Time after a few seconds, search "Temporary-display function timeout"
1515

1616
// These are the RLB board connections to Arduino analog input pins.
1717
// S1/PL13 = Reset
@@ -61,11 +61,11 @@ const char ledPin = 9;
6161
const byte unoffDur = 10; //sec
6262

6363
// How long (in ms) are the button hold durations?
64-
const word btnShortHold = 1000; //for setting the displayed feataure
65-
const word btnLongHold = 3000; //for for entering options menu
64+
const word btnShortHold = 1000; //for entering setting mode, or hold-setting at low velocity
65+
const word btnLongHold = 3000; //for entering options menu, or hold-setting at high velocity
6666
const word velThreshold = 0; //ms
6767
// When an adj up/down input (btn or rot) follows another in less than this time, value will change more (10 vs 1).
68-
// 0 to disable. Recommend ~150 for rotaries. If you want to use this feature with buttons, extend to ~400.
68+
// 0 to disable. Recommend ~150 for rotaries. If you want to use this feature with buttons, extend to ~300.
6969

7070
// What is the "frame rate" of the tube cleaning and display scrolling? up to 65535 ms
7171
const word cleanSpeed = 200; //ms

0 commit comments

Comments
 (0)