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
//Unmodified UNDB v8 with LED and relay disabled, and buttons as labeled, with 6-digit display.
2
+
3
+
#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 false // Adds date page with an anniversary counter
9
+
#defineENABLE_DATE_RISESET false // 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 false
12
+
#defineENABLE_ALARM_FIBONACCI false
13
+
#defineENABLE_TIMER_FN false
14
+
#defineENABLE_TIME_CHIME true
15
+
#defineENABLE_SHUTOFF_NIGHT true // If disabled, tubes will be full brightness all the time.
16
+
#defineENABLE_SHUTOFF_AWAY false // 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 RLB 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 A1 //main select button - must be equipped
32
+
#defineCTRL_UP A2 //main up/down buttons or rotary encoder - must be equipped
33
+
#defineCTRL_DN A3
34
+
#defineCTRL_ALT A0 //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 1
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]
//UNDB v9, relay disabled, buttons as labeled, with 6-digit display.
2
+
//Also for v8 modified to v9 spec (Sel/Alt on A6/A7, Up/Down on A0/A1, relay on A3, led on 9, and cathode B4 on A2)
3
+
4
+
#defineDISPLAY_SIZE 6 //number of tubes in display module. Small display adjustments are made for 4-tube clocks
5
+
6
+
// Which functionality is enabled in this clock?
7
+
// Related options will also be enabled in the options menu.
8
+
#defineENABLE_DATE_FN true // Date function, optionally including pages below
9
+
#defineENABLE_DATE_COUNTER false // Adds date page with an anniversary counter
10
+
#defineENABLE_DATE_RISESET false // Adds date pages with sunrise/sunset times. Requires DM Kichi's Dusk2Dawn library to be installed in IDE.
11
+
#defineENABLE_ALARM_FN true
12
+
#defineENABLE_ALARM_AUTOSKIP false
13
+
#defineENABLE_ALARM_FIBONACCI false
14
+
#defineENABLE_TIMER_FN false
15
+
#defineENABLE_TIME_CHIME true
16
+
#defineENABLE_SHUTOFF_NIGHT true // If disabled, tubes will be full brightness all the time.
17
+
#defineENABLE_SHUTOFF_AWAY false // Requires night shutoff.
18
+
#defineENABLE_TEMP_FN false //Temperature per DS3231 - will read high – leave false for production
19
+
#defineENABLE_TUBETEST_FN false //Cycles through all tubes – leave false for production
20
+
21
+
// These are the RLB board connections to Arduino analog input pins.
22
+
// S1/PL13 = Reset
23
+
// S2/PL5 = A1
24
+
// S3/PL6 = A0
25
+
// S4/PL7 = A6
26
+
// S5/PL8 = A3
27
+
// S6/PL9 = A2
28
+
// S7/PL14 = A7
29
+
// 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.
30
+
31
+
// What input is associated with each control?
32
+
#defineCTRL_SEL A6 //main select button - must be equipped
33
+
#defineCTRL_UP A0 //main up/down buttons or rotary encoder - must be equipped
34
+
#defineCTRL_DN A1
35
+
#defineCTRL_ALT A7 //alt select button - if unequipped, set to 0
36
+
37
+
// What type of up/down controls are equipped?
38
+
// 1 = momentary buttons. 2 = quadrature rotary encoder: requires Paul Stoffregen's Encoder library to be installed in IDE.
39
+
#defineCTRL_UPDN_TYPE 1
40
+
#defineROT_VEL_START 80 //Required if CTRL_UPDN_TYPE==2. If step rate falls below this, kick into high velocity set (x10)
41
+
#defineROT_VEL_STOP 500 //Required if CTRL_UPDN_TYPE==2. If encoder step rate rises above this, drop into low velocity set (x1)
42
+
43
+
// How long (in ms) are the button hold durations?
44
+
#defineCTRL_HOLD_SHORT_DUR 1000 //for entering setting mode, or hold-setting at low velocity (x1)
45
+
#defineCTRL_HOLD_LONG_DUR 3000 //for entering options menu, or hold-setting at high velocity (x10)
46
+
47
+
//What are the signal pin(s) connected to?
48
+
#definePIEZO_PIN 10
49
+
#defineRELAY_PIN -1 // -1 to disable feature (no relay item equipped); A3 if equipped (UNDB v9)
50
+
#defineRELAY_MODE 0 //If relay is equipped, what does it do?
51
+
// 0 = switched mode: the relay will be switched to control an appliance like a radio or light fixture. If used with timer, it will switch on while timer is running (like a "sleep" function). If used with alarm, it will switch on when alarm trips; specify duration of this in SWITCH_DUR.
52
+
// 1 = pulsed mode: the relay will be pulsed, like the beeper is, to control an intermittent signaling device like a solenoid or indicator lamp. Specify pulse duration in RELAY_PULSE.
53
+
#defineSIGNAL_DUR 180 //sec - when pulsed signal is going, pulses are sent once/sec for this period (e.g. 180 = 3min)
54
+
#defineSWITCH_DUR 7200 //sec - when alarm triggers switched relay, it's switched on for this period (e.g. 7200 = 2hr)
55
+
#definePIEZO_PULSE 250 //ms - used with piezo via tone()
56
+
#defineRELAY_PULSE 200 //ms - used with pulsed relay
57
+
58
+
//Soft power switches
59
+
#defineENABLE_SOFT_ALARM_SWITCH 1
60
+
// 1 = yes. Alarm can be switched on and off when clock is displaying the alarm time (fnIsAlarm).
61
+
// 0 = no. Alarm will be permanently on. Use with switched relay if the appliance has its own switch on this relay circuit.
62
+
#defineENABLE_SOFT_POWER_SWITCH 1 //works with switched relay only
63
+
// 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).
64
+
// 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.
65
+
66
+
//LED circuit control
67
+
#defineLED_PIN 9 // -1 to disable feature; 9 if equipped (UNDB v9)
68
+
69
+
//When display is dim/off, a press will light the tubes for how long?
70
+
#defineUNOFF_DUR 10 //sec
71
+
72
+
// What is the "frame rate" of the tube cleaning and display scrolling? up to 65535 ms
73
+
#defineCLEAN_SPEED 200 //ms
74
+
#defineSCROLL_SPEED 100 //ms - e.g. scroll-in-and-out date at :30
75
+
76
+
// What are the timeouts for setting and temporarily-displayed functions? up to 65535 sec
77
+
#defineSETTING_TIMEOUT 300 //sec
78
+
#defineFN_TEMP_TIMEOUT 5 //sec
79
+
#defineFN_PAGE_TIMEOUT 3 //sec
80
+
81
+
//This clock is 2x3 multiplexed: two tubes powered at a time.
82
+
//The anode channel determines which two tubes are powered,
83
+
//and the two SN74141 cathode driver chips determine which digits are lit.
84
+
//4 pins out to each SN74141, representing a binary number with values [1,2,4,8]
0 commit comments