Skip to content

Commit efd7a1f

Browse files
committed
simplified v8/v9 configs
1 parent a2aadb4 commit efd7a1f

File tree

2 files changed

+187
-0
lines changed

2 files changed

+187
-0
lines changed
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
//Unmodified UNDB v8 with LED and relay disabled, and buttons as labeled, with 6-digit display.
2+
3+
#define DISPLAY_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+
#define ENABLE_DATE_FN true // Date function, optionally including pages below
8+
#define ENABLE_DATE_COUNTER false // Adds date page with an anniversary counter
9+
#define ENABLE_DATE_RISESET false // Adds date pages with sunrise/sunset times. Requires DM Kichi's Dusk2Dawn library to be installed in IDE.
10+
#define ENABLE_ALARM_FN true
11+
#define ENABLE_ALARM_AUTOSKIP false
12+
#define ENABLE_ALARM_FIBONACCI false
13+
#define ENABLE_TIMER_FN false
14+
#define ENABLE_TIME_CHIME true
15+
#define ENABLE_SHUTOFF_NIGHT true // If disabled, tubes will be full brightness all the time.
16+
#define ENABLE_SHUTOFF_AWAY false // Requires night shutoff.
17+
#define ENABLE_TEMP_FN false //Temperature per DS3231 - will read high – leave false for production
18+
#define ENABLE_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+
#define CTRL_SEL A1 //main select button - must be equipped
32+
#define CTRL_UP A2 //main up/down buttons or rotary encoder - must be equipped
33+
#define CTRL_DN A3
34+
#define CTRL_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+
#define CTRL_UPDN_TYPE 1
39+
#define ROT_VEL_START 80 //Required if CTRL_UPDN_TYPE==2. If step rate falls below this, kick into high velocity set (x10)
40+
#define ROT_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+
#define CTRL_HOLD_SHORT_DUR 1000 //for entering setting mode, or hold-setting at low velocity (x1)
44+
#define CTRL_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+
#define PIEZO_PIN 10
48+
#define RELAY_PIN -1 //don't change - not available until UNDB v9 (or modded v8 - see v9 configs)
49+
#define RELAY_MODE 0 //don't change - not available until UNDB v9 (or modded v8 - see v9 configs)
50+
#define SIGNAL_DUR 180 //sec - when pulsed signal is going, pulses are sent once/sec for this period (e.g. 180 = 3min)
51+
#define SWITCH_DUR 7200 //sec - when alarm triggers switched relay, it's switched on for this period (e.g. 7200 = 2hr)
52+
#define PIEZO_PULSE 250 //ms - used with piezo via tone()
53+
#define RELAY_PULSE 200 //ms - used with pulsed relay
54+
55+
//Soft power switches
56+
#define ENABLE_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+
#define ENABLE_SOFT_POWER_SWITCH 0 //don't change - not available until UNDB v9 (or modded v8 - see v9 configs)
60+
61+
//LED circuit control
62+
#define LED_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+
#define UNOFF_DUR 10 //sec
66+
67+
// What is the "frame rate" of the tube cleaning and display scrolling? up to 65535 ms
68+
#define CLEAN_SPEED 200 //ms
69+
#define SCROLL_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+
#define SETTING_TIMEOUT 300 //sec
73+
#define FN_TEMP_TIMEOUT 5 //sec
74+
#define FN_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]
80+
#define OUT_A1 2
81+
#define OUT_A2 3
82+
#define OUT_A3 4
83+
#define OUT_A4 5
84+
#define OUT_B1 6
85+
#define OUT_B2 7
86+
#define OUT_B3 8
87+
#define OUT_B4 9
88+
//3 pins out to anode channel switches
89+
#define ANODE_1 11
90+
#define ANODE_2 12
91+
#define ANODE_3 13
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
//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+
#define DISPLAY_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+
#define ENABLE_DATE_FN true // Date function, optionally including pages below
9+
#define ENABLE_DATE_COUNTER false // Adds date page with an anniversary counter
10+
#define ENABLE_DATE_RISESET false // Adds date pages with sunrise/sunset times. Requires DM Kichi's Dusk2Dawn library to be installed in IDE.
11+
#define ENABLE_ALARM_FN true
12+
#define ENABLE_ALARM_AUTOSKIP false
13+
#define ENABLE_ALARM_FIBONACCI false
14+
#define ENABLE_TIMER_FN false
15+
#define ENABLE_TIME_CHIME true
16+
#define ENABLE_SHUTOFF_NIGHT true // If disabled, tubes will be full brightness all the time.
17+
#define ENABLE_SHUTOFF_AWAY false // Requires night shutoff.
18+
#define ENABLE_TEMP_FN false //Temperature per DS3231 - will read high – leave false for production
19+
#define ENABLE_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+
#define CTRL_SEL A6 //main select button - must be equipped
33+
#define CTRL_UP A0 //main up/down buttons or rotary encoder - must be equipped
34+
#define CTRL_DN A1
35+
#define CTRL_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+
#define CTRL_UPDN_TYPE 1
40+
#define ROT_VEL_START 80 //Required if CTRL_UPDN_TYPE==2. If step rate falls below this, kick into high velocity set (x10)
41+
#define ROT_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+
#define CTRL_HOLD_SHORT_DUR 1000 //for entering setting mode, or hold-setting at low velocity (x1)
45+
#define CTRL_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+
#define PIEZO_PIN 10
49+
#define RELAY_PIN -1 // -1 to disable feature (no relay item equipped); A3 if equipped (UNDB v9)
50+
#define RELAY_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+
#define SIGNAL_DUR 180 //sec - when pulsed signal is going, pulses are sent once/sec for this period (e.g. 180 = 3min)
54+
#define SWITCH_DUR 7200 //sec - when alarm triggers switched relay, it's switched on for this period (e.g. 7200 = 2hr)
55+
#define PIEZO_PULSE 250 //ms - used with piezo via tone()
56+
#define RELAY_PULSE 200 //ms - used with pulsed relay
57+
58+
//Soft power switches
59+
#define ENABLE_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+
#define ENABLE_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+
#define LED_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+
#define UNOFF_DUR 10 //sec
71+
72+
// What is the "frame rate" of the tube cleaning and display scrolling? up to 65535 ms
73+
#define CLEAN_SPEED 200 //ms
74+
#define SCROLL_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+
#define SETTING_TIMEOUT 300 //sec
78+
#define FN_TEMP_TIMEOUT 5 //sec
79+
#define FN_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]
85+
#define OUT_A1 2
86+
#define OUT_A2 3
87+
#define OUT_A3 4
88+
#define OUT_A4 5
89+
#define OUT_B1 6
90+
#define OUT_B2 7
91+
#define OUT_B3 8
92+
#define OUT_B4 16 //aka A2
93+
//3 pins out to anode channel switches
94+
#define ANODE_1 11
95+
#define ANODE_2 12
96+
#define ANODE_3 13

0 commit comments

Comments
 (0)