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
Copy file name to clipboardExpand all lines: README.md
+5-4
Original file line number
Diff line number
Diff line change
@@ -67,7 +67,7 @@ This feature can count up (chrono) or down (timer), up to 100 hours each way. Wh
67
67
> **Hardware variations**
68
68
> * If your clock has a [switched relay](#hardware-configuration) and the chrono/timer is [set to use it](#optionstimer), it will switch on while the timer is running, like the “sleep” function on a clock radio. The runout options will still work, but won’t signal.
69
69
> * If your clock does not have a beeper, the runout options cannot be set.
70
-
> * If your clock uses a rotary encoder for **Up/Down** rather than buttons, **Down** will stop the chrono/timer, and **Up** will display lap times (chrono) and cycle through runout options (timer).
70
+
> * If your clock uses a rotary encoder for **Up/Down** rather than buttons, while running, **Up** will display lap times (chrono) and cycle through runout options (timer), and **Down** will stop. To prevent accidental resets, **Down** does nothing while stopped. To reset to `0`, simply switch to another display while stopped.
71
71
72
72
## The Alt button
73
73
@@ -150,11 +150,12 @@ You can also set the **defaults for the options menu** (in main code, currently)
150
150
151
151
## Compiling the sketch
152
152
153
-
**To compile the sketch,** ensure these libraries are added and enabled in your Arduino IDE, via the Library Manager:
153
+
**To compile the sketch,** ensure these libraries are installed in your Arduino IDE via Library Manager, as needed:
*[DS3231](https://github.com/NorthernWidget/DS3231) by NorthernWidget
158
+
*[Dusk2Dawn](https://github.com/dmkishi/Dusk2Dawn) by DM Kishi - if sunrise/sunset display is enabled
159
+
*[Encoder](https://github.com/PaulStoffregen/Encoder) by Paul Stoffregen - if rotary encoder is equipped
159
160
160
161
**To upload the sketch to your clock,** if it doesn’t appear in the IDE’s Ports menu (as a USB port), your UNDB may be equipped with an Arduino clone that requires [drivers for the CH340 chipset](https://sparks.gogo.co.nz/ch340.html).
constbytedisplaySize=4;//number of tubes in display module. Small display adjustments are made for 4-tube clocks
3
+
#defineDISPLAY_SIZE 4 //number of tubes in display module. Small display adjustments are made for 4-tube clocks
4
4
5
5
// Which functionality is enabled in this clock?
6
6
// Related options will also be enabled in the options menu.
7
-
constboolenableDate= true;
8
-
constboolenableDateCounter=true;// Adds a "page" to the date with an anniversary counter
9
-
constboolenableDateSunriseSunset=true;// Adds "pages" to the date with sunrise/sunset times
10
-
constboolenableAlarm=true;
11
-
constboolenableAlarmAutoskip=true;
12
-
constboolenableAlarmFibonacci=true;
13
-
constboolenableTimer=true;
14
-
constboolenableChime=true;
15
-
constboolenableNightShutoff=true;// If disabled, tubes will be full brightness all the time.
16
-
constboolenableAwayShutoff=true;// Requires night shutoff.
17
-
constboolenableTemp=false;//Temperature per DS3231 - will read high – leave false for production
18
-
constboolenableTest=false;//Cycles through all tubes – leave false for production
7
+
#defineENABLE_DATE_FN true // Date function, optionally including pages below
8
+
#defineENABLE_DATE_COUNTERtrue // Adds date page with an anniversary counter
9
+
#defineENABLE_DATE_RISESETtrue // Adds date pages with sunrise/sunset times. Requires DM Kichi's Dusk2Dawn library to be installed in IDE.
10
+
#defineENABLE_ALARM_FNtrue
11
+
#defineENABLE_ALARM_AUTOSKIPtrue
12
+
#defineENABLE_ALARM_FIBONACCItrue
13
+
#defineENABLE_TIMER_FNtrue
14
+
#defineENABLE_TIME_CHIMEtrue
15
+
#defineENABLE_SHUTOFF_NIGHTtrue // If disabled, tubes will be full brightness all the time.
16
+
#defineENABLE_SHUTOFF_AWAYtrue // Requires night shutoff.
17
+
#defineENABLE_TEMP_FNfalse //Temperature per DS3231 - will read high – leave false for production
18
+
#defineENABLE_TUBETEST_FNfalse //Cycles through all tubes – leave false for production
19
19
20
20
// These are the UNDB v5 board connections to Arduino analog input pins.
21
21
// S1/PL13 = Reset
@@ -28,64 +28,64 @@ const bool enableTest = false; //Cycles through all tubes – leave false for pr
28
28
// 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.
29
29
30
30
// What input is associated with each control?
31
-
constbytemainSel=A2;//main select button - must be equipped
32
-
constbytemainAdjUp=A1;//main up/down buttons or rotary encoder - must be equipped
33
-
constbytemainAdjDn=A0;
34
-
constbytealtSel=0;//alt select button - if unequipped, set to 0
31
+
#defineCTRL_SEL A2 //main select button - must be equipped
32
+
#defineCTRL_UP A1 //main up/down buttons or rotary encoder - must be equipped
33
+
#defineCTRL_DN A0
34
+
#defineCTRL_ALT 0 //alt select button - if unequipped, set to 0
#defineDISPLAY_SIZE 6 //number of tubes in display module. Small display adjustments are made for 4-tube clocks
4
+
5
+
// Which functionality is enabled in this clock?
6
+
// Related options will also be enabled in the options menu.
7
+
#defineENABLE_DATE_FN true // Date function, optionally including pages below
8
+
#defineENABLE_DATE_COUNTER true // Adds date page with an anniversary counter
9
+
#defineENABLE_DATE_RISESET true // Adds date pages with sunrise/sunset times. Requires DM Kichi's Dusk2Dawn library to be installed in IDE.
10
+
#defineENABLE_ALARM_FN true
11
+
#defineENABLE_ALARM_AUTOSKIP true
12
+
#defineENABLE_ALARM_FIBONACCI true
13
+
#defineENABLE_TIMER_FN true
14
+
#defineENABLE_TIME_CHIME true
15
+
#defineENABLE_SHUTOFF_NIGHT true // If disabled, tubes will be full brightness all the time.
16
+
#defineENABLE_SHUTOFF_AWAY true // Requires night shutoff.
17
+
#defineENABLE_TEMP_FN false //Temperature per DS3231 - will read high – leave false for production
18
+
#defineENABLE_TUBETEST_FN false //Cycles through all tubes – leave false for production
19
+
20
+
// These are the UNDB v5 board connections to Arduino analog input pins.
21
+
// S1/PL13 = Reset
22
+
// S2/PL5 = A1
23
+
// S3/PL6 = A0
24
+
// S4/PL7 = A6
25
+
// S5/PL8 = A3
26
+
// S6/PL9 = A2
27
+
// S7/PL14 = A7
28
+
// 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.
29
+
30
+
// What input is associated with each control?
31
+
#defineCTRL_SEL A2 //main select button - must be equipped
32
+
#defineCTRL_UP A1 //main up/down buttons or rotary encoder - must be equipped
33
+
#defineCTRL_DN A0
34
+
#defineCTRL_ALT 0 //alt select button - if unequipped, set to 0
35
+
36
+
// What type of up/down controls are equipped?
37
+
// 1 = momentary buttons. 2 = quadrature rotary encoder: requires Paul Stoffregen's Encoder library to be installed in IDE.
38
+
#defineCTRL_UPDN_TYPE 2
39
+
#defineROT_VEL_START 80 //Required if CTRL_UPDN_TYPE==2. If step rate falls below this, kick into high velocity set (x10)
40
+
#defineROT_VEL_STOP 500 //Required if CTRL_UPDN_TYPE==2. If encoder step rate rises above this, drop into low velocity set (x1)
41
+
42
+
// How long (in ms) are the button hold durations?
43
+
#defineCTRL_HOLD_SHORT_DUR 1000 //for entering setting mode, or hold-setting at low velocity (x1)
44
+
#defineCTRL_HOLD_LONG_DUR 3000 //for entering options menu, or hold-setting at high velocity (x10)
45
+
46
+
//What are the signal pin(s) connected to?
47
+
#definePIEZO_PIN 10
48
+
#defineRELAY_PIN -1 //don't change - not available until UNDB v9 (or modded v8 - see v9 configs)
49
+
#defineRELAY_MODE 0 //don't change - not available until UNDB v9 (or modded v8 - see v9 configs)
50
+
#defineSIGNAL_DUR 180 //sec - when pulsed signal is going, pulses are sent once/sec for this period (e.g. 180 = 3min)
51
+
#defineSWITCH_DUR 7200 //sec - when alarm triggers switched relay, it's switched on for this period (e.g. 7200 = 2hr)
52
+
#definePIEZO_PULSE 250 //ms - used with piezo via tone()
53
+
#defineRELAY_PULSE 200 //ms - used with pulsed relay
54
+
55
+
//Soft power switches
56
+
#defineENABLE_SOFT_ALARM_SWITCH 1
57
+
// 1 = yes. Alarm can be switched on and off when clock is displaying the alarm time (fnIsAlarm).
58
+
// 0 = no. Alarm will be permanently on. Use with switched relay if the appliance has its own switch on this relay circuit.
59
+
#defineENABLE_SOFT_POWER_SWITCH 0 //don't change - not available until UNDB v9 (or modded v8 - see v9 configs)
60
+
61
+
//LED circuit control
62
+
#defineLED_PIN -1 //don't change - not available until UNDB v9 (or modded v8 - see v9 configs)
63
+
64
+
//When display is dim/off, a press will light the tubes for how long?
65
+
#defineUNOFF_DUR 10 //sec
66
+
67
+
// What is the "frame rate" of the tube cleaning and display scrolling? up to 65535 ms
68
+
#defineCLEAN_SPEED 200 //ms
69
+
#defineSCROLL_SPEED 100 //ms - e.g. scroll-in-and-out date at :30
70
+
71
+
// What are the timeouts for setting and temporarily-displayed functions? up to 65535 sec
72
+
#defineSETTING_TIMEOUT 300 //sec
73
+
#defineFN_TEMP_TIMEOUT 5 //sec
74
+
#defineFN_PAGE_TIMEOUT 3 //sec
75
+
76
+
//This clock is 2x3 multiplexed: two tubes powered at a time.
77
+
//The anode channel determines which two tubes are powered,
78
+
//and the two SN74141 cathode driver chips determine which digits are lit.
79
+
//4 pins out to each SN74141, representing a binary number with values [1,2,4,8]
0 commit comments