Skip to content

Commit 12b6c0f

Browse files
committed
Finished Alt function preset; small bugfixes; readme updates (inc. "Alt" becomes "Up/Down")
1 parent 8b2ba0f commit 12b6c0f

File tree

8 files changed

+34
-74
lines changed

8 files changed

+34
-74
lines changed

README.md

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,15 @@ _Note: Many variations are possible, depending on your clock's hardware; but thi
1212

1313
### Clock Functions
1414

15-
* Press **Select** to cycle through the clock's functions. Some return to Time after a few seconds.
16-
* To set, hold **Select** 'til the display flashes; use **Adjust** to set, and **Select** to save.
15+
* Press **Select** to cycle through the clock's functions.
16+
* After a few seconds, the display will return to **Time**, except for the running timer and the preset function (see below).
17+
* To set, hold **Select** until the display flashes; use **Up/Down** to set, and **Select** to save.
1718

1819
| Function | Looks like | Notes |
1920
| --- | --- | --- |
2021
| **Time** | `12 34 56` | The time of day. You can choose 12h or 24h format in the options menu (1). When setting, it's in 24h format (so you can tell AM from PM) and the seconds will reset to :00 when you save. The clock keeps time during power outages and compensates for temperature effects. |
2122
| **Date** | `_2 _4 _0`<br/>(for&nbsp;Sun&nbsp;2/4) | You can choose the date format in the options menu (2). Setting is done in three stages: first year, then month, then date.<br/>Weekdays are: 0=Sun, 1=Mon, 2=Tue, 3=Wed, 4=Thu, 5=Fri, 6=Sat |
22-
| **Alarm** | `_7 00 1_` | Shows alarm time (always in 24hr format) and on/off status on 5th tube (1=on, 0=off) and by display brightness (bright=on, dim=off). Use **Adjust** to switch on/off. Hold **Select** to set time (same way as **Time**). When alarm sounds, press any button to snooze, or hold for 1sec (followed by a short beep) to silence the alarm for the day. Options menu lets you restrict the alarm to your workweek or weekend only. In a power outage, the alarm will remain set, but it will not sound if power is disconnected at alarm time. |
23+
| **Alarm** | `_7 00 1_` | Shows alarm time (always in 24hr format) and on/off status on 5th tube (1=on, 0=off) and by display brightness (bright=on, dim=off). Use **Up** to switch on, and **Down** to switch off. Hold **Select** to set time (same way as **Time**). When alarm sounds, press any button to snooze, or hold for 1sec (followed by a short beep) to silence the alarm for the day. Options menu lets you restrict the alarm to your workweek or weekend only. In a power outage, the alarm will remain set, but it will not sound if power is disconnected at alarm time. |
2324
| **Timer** | `__ __ _0` | A countdown timer, in hours, minutes, and seconds; or `0` when stopped. Can be set to the minute, up to 18 hours. Begins running as soon as you set it, and will continue to run in the background if you change to a different function. To cancel while running, hold **Select**. When timer runs out, press **Select** to silence. If power is lost, the timer will reset to `0`. Can be configured to work as an interval timer in the options menu (10). |
2425
| **Day counter** | `_1 23 __` | Shows the number of days until/since a date you specify. Set the same way as **Date.** |
2526
| **Temperature** | `__ 38 25` | Shows the temperature of the onboard DS3231 chip (e.g. 38.25°C – I think). May not be very useful as it tends to read higher than ambient temperature and its tolerance is low. Negative temperatures indicated with leading zeroes. |
@@ -32,14 +33,22 @@ Later UNDBs (v8 with mods, or v9+) are equipped with controllable LEDs, as well
3233
* The LED behavior is configurable in option 7, and can be set to switch on and off with the relay if enabled (great for a radio!)
3334
* The alarm, timer, and strike signals can be configured to use either the beeper or the relay if enabled (options 11, 21, and 31 – strike can only use the relay in pulse mode).
3435
* With the relay in switch mode:
35-
* **Alt** will switch it on and off at any time (except in options menu). (Otherwise, **Alt** does nothing.)
36+
* **Alt** will switch it on and off at any time (except in options menu, and only if the soft power switch is enabled).
3637
* If the alarm is set to use the relay, it will switch on the relay at alarm time, and switch off two hours later. If **Alt** is used to switch it off, the alarm will be silenced for the day (skipping snooze).
37-
* If the timer is set to use the relay, it will switch on while the timer is running, and switch off when it runs out, like a clock radio's sleep function. If **Alt** is used to switch it off, the timer will be cancelled. (The interval timer option cannot be used in this case.)
38+
* If the timer is set to use the relay, it will switch on while the timer is running, and switch off when it runs out, like a clock radio's sleep function. If **Alt** is used to switch it off, the timer will be cancelled. (The interval timer option cannot be used with the relay in switch mode.)
39+
40+
### Function Preset
41+
42+
If you are not using a switched relay and/or the soft power switch is not enabled, the **Alt** button acts as a function preset, to let you quickly access a function of your choice.
43+
44+
* Press **Alt** to jump immediately to the preset function (or back to **Time**).
45+
* To change the preset function, use **Select** to scroll to that function, then hold **Alt** until the display flashes and you hear two beeps.
46+
* Most functions return to **Time** after a few seconds, but the preset function will not. You can use this to make a function stay on display.
3847

3948
### Options Menu
4049

4150
* To access this, hold **Select** for 3 seconds until you see a single `1` on the hour tubes. This indicates option number 1.
42-
* Use **Adjust** to go to the option number you want to set (see table below); press **Select** to open it for setting (display will flash); use **Adjust** to set; and **Select** to save.
51+
* Use **Up/Down** to go to the option number you want to set (see table below); press **Select** to open it for setting (display will flash); use **Up/Down** to set; and **Select** to save.
4352
* When all done, hold **Select** to exit the options menu.
4453

4554
| | Option | Settings |
@@ -85,19 +94,19 @@ A number of hardware-related settings are specified in config files, one of whic
8594

8695
* **How many tubes** in the display module. Default is 6; small display adjustments are made for 4-tube clocks.
8796
* **Which functions** are enabled. Default is all but temperature and tube tester.
88-
* **Which input pins** are associated with the Select and Adjust controls.
89-
* **What type of Adjust controls** are equipped: pushbuttons (default) or rotary encoder (unimplemented).
97+
* **Which pins** are associated with the inputs (controls) and outputs (LED, relay, anodes, cathodes).
98+
* **What type of Up/Down controls** are equipped: pushbuttons (default) or rotary encoder (unimplemented).
9099
* **What type of signal outputs** are equipped: a piezo beeper (default) and/or a relay.
91100
* **Signal duration** (default 3min) and **piezo pulse duration** (default 500ms)
92101
* If relay is equipped, **relay mode**:
93102
* In switched mode (default), 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 **relay switch duration** (default 2 hours).
94103
* In pulse mode, the relay will be pulsed, like the beeper is, to control an intermittent signaling device like a solenoid or indicator lamp; specify **relay pulse duration** (default 200ms).
95-
* **Soft alarm switch** enabled: default is yes; it is switched with Adjust while viewing the alarm time. Change to no if the signal output/appliance has its own switch on this relay circuit; the clock's alarm will be permanently on.
96-
* **Soft power switch** enabled (switched relay only): default is yes; appliance can be switched manually with Adjust while viewing the time of day. Change to no if the appliance has its own power switch (independent of this relay circuit) or does not need to be manually switched.
104+
* **Soft alarm switch** enabled: default is yes; it is switched with **Up** (on) and **Down** (off) while viewing the alarm time. Change to no if the signal output/appliance has its own switch on this relay circuit; the clock's alarm will be permanently on.
105+
* **Soft power switch** enabled (switched relay only): default is yes; appliance can be toggled on/off with **Alt**. Change to no if the appliance has its own power switch (independent of this relay circuit) or does not need to be manually switched. (If set to no, or not using a switched relay, **Alt** acts as a function preset, as above.)
97106
* **Various other durations** for things like scrolling speed, set mode timeouts, short and long button holds, "hold to set faster" thresholds, etc.
98107

99108
You can also set the **defaults for the options menu** (in main code, currently) to better suit the clock's intended use.
100109

101-
**To compile the edited sketch:** You will need to add the [ooPinChangeInt](https://code.google.com/archive/p/oopinchangeint/downloads) and [NorthernWidget DS3231](https://github.com/NorthernWidget/DS3231) libraries to your Arduino IDE.
110+
**To compile the edited sketch:** You will need to add the [NorthernWidget DS3231](https://github.com/NorthernWidget/DS3231) libraries to your Arduino IDE.
102111

103112
**To upload the sketch to the UNDB:** 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).

sixtube_lm/configs/v5-4tube.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,6 @@ const byte altSel = 0; //alt select button - if unequipped, set to 0
3434
// 1 = momentary buttons. 2 = quadrature rotary encoder.
3535
const byte mainAdjType = 2;
3636

37-
// In normal running mode, what do the controls do?
38-
// -1 = nothing/switch, -2 = cycle through functions, fn in fnsEnabled[] = go to that function
39-
// If using soft alarm/power switch per below, the control(s) set to -1 will do the switching.
40-
const char mainSelFn = -2;
41-
const char mainAdjFn = -1;
42-
const byte altSelFn = -1;
43-
4437
//What are the signal pin(s) connected to?
4538
const char piezoPin = 10;
4639
const char relayPin = -1; //don't change - not available until UNDB v8

sixtube_lm/configs/v5-6tube.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,6 @@ const byte altSel = 0; //alt select button - if unequipped, set to 0
3434
// 1 = momentary buttons. 2 = quadrature rotary encoder.
3535
const byte mainAdjType = 1;
3636

37-
// In normal running mode, what do the controls do?
38-
// -1 = nothing/switch, -2 = cycle through functions, fn in fnsEnabled[] = go to that function
39-
// If using soft alarm/power switch per below, the control(s) set to -1 will do the switching.
40-
const char mainSelFn = -2;
41-
const char mainAdjFn = -1;
42-
const byte altSelFn = -1;
43-
4437
//What are the signal pin(s) connected to?
4538
const char piezoPin = 10;
4639
const char relayPin = -1; //don't change - not available until UNDB v8

sixtube_lm/configs/v8-4tube.h

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,6 @@ const byte altSel = A0; //alt select button - if unequipped, set to 0
3434
// 1 = momentary buttons. 2 = quadrature rotary encoder.
3535
const byte mainAdjType = 1;
3636

37-
// In normal running mode, what do the controls do?
38-
// -1 = nothing/switch, -2 = cycle through functions, fn in fnsEnabled[] = go to that function
39-
// If using soft alarm/power switch per below, the control(s) set to -1 will do the switching.
40-
const char mainSelFn = -2;
41-
const char mainAdjFn = -1;
42-
const byte altSelFn = fnIsAlarm; //go straight to alarm
43-
4437
//What are the signal pin(s) connected to?
4538
const char piezoPin = 10;
4639
const char relayPin = -1;
@@ -59,8 +52,7 @@ const byte enableSoftAlarmSwitch = 1;
5952
// 0 = no. Alarm will be permanently on. Use with switched relay if the appliance has its own switch on this relay circuit.
6053
const byte enableSoftPowerSwitch = 1; //works with switched relay only
6154
// 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).
62-
// 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.
63-
const byte altSelFn = fnIsAlarm; //If no switched relay or no soft power switch, pressing Alt will jump straight to this function (or back to Time).
55+
// 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.
6456

6557
//LED circuit control
6658
const char ledPin = -1;

sixtube_lm/configs/v8-6tube.h

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,6 @@ const byte altSel = A0; //alt select button - if unequipped, set to 0
3434
// 1 = momentary buttons. 2 = quadrature rotary encoder.
3535
const byte mainAdjType = 1;
3636

37-
// In normal running mode, what do the controls do?
38-
// -1 = nothing/switch, -2 = cycle through functions, fn in fnsEnabled[] = go to that function
39-
// If using soft alarm/power switch per below, the control(s) set to -1 will do the switching.
40-
const char mainSelFn = -2;
41-
const char mainAdjFn = -1;
42-
const byte altSelFn = fnIsAlarm; //go straight to alarm
43-
4437
//What are the signal pin(s) connected to?
4538
const char piezoPin = 10;
4639
const char relayPin = -1;
@@ -59,8 +52,7 @@ const byte enableSoftAlarmSwitch = 1;
5952
// 0 = no. Alarm will be permanently on. Use with switched relay if the appliance has its own switch on this relay circuit.
6053
const byte enableSoftPowerSwitch = 1; //works with switched relay only
6154
// 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).
62-
// 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.
63-
const byte altSelFn = fnIsAlarm; //If no switched relay or no soft power switch, pressing Alt will jump straight to this function (or back to Time).
55+
// 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.
6456

6557
//LED circuit control
6658
const char ledPin = -1;

sixtube_lm/configs/v8c-6tube-relayswitch-pwm-top.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@ const byte enableSoftAlarmSwitch = 1;
5252
// 0 = no. Alarm will be permanently on. Use with switched relay if the appliance has its own switch on this relay circuit.
5353
const byte enableSoftPowerSwitch = 1; //works with switched relay only
5454
// 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).
55-
// 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.
56-
const byte altSelFn = fnIsAlarm; //If no switched relay or no soft power switch, pressing Alt will jump straight to this function (or back to Time).
55+
// 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.
5756

5857
//LED circuit control with PWM
5958
const char ledPin = 9;

sixtube_lm/configs/v8c-6tube-relayswitch-pwm.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@ const byte enableSoftAlarmSwitch = 1;
5252
// 0 = no. Alarm will be permanently on. Use with switched relay if the appliance has its own switch on this relay circuit.
5353
const byte enableSoftPowerSwitch = 1; //works with switched relay only
5454
// 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).
55-
// 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.
56-
const byte altSelFn = fnIsAlarm; //If no switched relay or no soft power switch, pressing Alt will jump straight to this function (or back to Time).
55+
// 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.
5756

5857
//LED circuit control with PWM
5958
const char ledPin = 9;

0 commit comments

Comments
 (0)