Skip to content

Commit

Permalink
Finished Alt function preset; small bugfixes; readme updates (inc. "A…
Browse files Browse the repository at this point in the history
…lt" becomes "Up/Down")
  • Loading branch information
clockspot committed Oct 27, 2018
1 parent 8b2ba0f commit 12b6c0f
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 74 deletions.
31 changes: 20 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@ _Note: Many variations are possible, depending on your clock's hardware; but thi

### Clock Functions

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

| Function | Looks like | Notes |
| --- | --- | --- |
| **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. |
| **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 |
| **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. |
| **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. |
| **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). |
| **Day counter** | `_1 23 __` | Shows the number of days until/since a date you specify. Set the same way as **Date.** |
| **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. |
Expand All @@ -32,14 +33,22 @@ Later UNDBs (v8 with mods, or v9+) are equipped with controllable LEDs, as well
* 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!)
* 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).
* With the relay in switch mode:
* **Alt** will switch it on and off at any time (except in options menu). (Otherwise, **Alt** does nothing.)
* **Alt** will switch it on and off at any time (except in options menu, and only if the soft power switch is enabled).
* 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).
* 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.)
* 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.)

### Function Preset

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.

* Press **Alt** to jump immediately to the preset function (or back to **Time**).
* To change the preset function, use **Select** to scroll to that function, then hold **Alt** until the display flashes and you hear two beeps.
* 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.

### Options Menu

* To access this, hold **Select** for 3 seconds until you see a single `1` on the hour tubes. This indicates option number 1.
* 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.
* 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.
* When all done, hold **Select** to exit the options menu.

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

* **How many tubes** in the display module. Default is 6; small display adjustments are made for 4-tube clocks.
* **Which functions** are enabled. Default is all but temperature and tube tester.
* **Which input pins** are associated with the Select and Adjust controls.
* **What type of Adjust controls** are equipped: pushbuttons (default) or rotary encoder (unimplemented).
* **Which pins** are associated with the inputs (controls) and outputs (LED, relay, anodes, cathodes).
* **What type of Up/Down controls** are equipped: pushbuttons (default) or rotary encoder (unimplemented).
* **What type of signal outputs** are equipped: a piezo beeper (default) and/or a relay.
* **Signal duration** (default 3min) and **piezo pulse duration** (default 500ms)
* If relay is equipped, **relay mode**:
* 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).
* 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).
* **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.
* **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.
* **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.
* **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.)
* **Various other durations** for things like scrolling speed, set mode timeouts, short and long button holds, "hold to set faster" thresholds, etc.

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

**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.
**To compile the edited sketch:** You will need to add the [NorthernWidget DS3231](https://github.com/NorthernWidget/DS3231) libraries to your Arduino IDE.

**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).
7 changes: 0 additions & 7 deletions sixtube_lm/configs/v5-4tube.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,6 @@ const byte altSel = 0; //alt select button - if unequipped, set to 0
// 1 = momentary buttons. 2 = quadrature rotary encoder.
const byte mainAdjType = 2;

// In normal running mode, what do the controls do?
// -1 = nothing/switch, -2 = cycle through functions, fn in fnsEnabled[] = go to that function
// If using soft alarm/power switch per below, the control(s) set to -1 will do the switching.
const char mainSelFn = -2;
const char mainAdjFn = -1;
const byte altSelFn = -1;

//What are the signal pin(s) connected to?
const char piezoPin = 10;
const char relayPin = -1; //don't change - not available until UNDB v8
Expand Down
7 changes: 0 additions & 7 deletions sixtube_lm/configs/v5-6tube.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,6 @@ const byte altSel = 0; //alt select button - if unequipped, set to 0
// 1 = momentary buttons. 2 = quadrature rotary encoder.
const byte mainAdjType = 1;

// In normal running mode, what do the controls do?
// -1 = nothing/switch, -2 = cycle through functions, fn in fnsEnabled[] = go to that function
// If using soft alarm/power switch per below, the control(s) set to -1 will do the switching.
const char mainSelFn = -2;
const char mainAdjFn = -1;
const byte altSelFn = -1;

//What are the signal pin(s) connected to?
const char piezoPin = 10;
const char relayPin = -1; //don't change - not available until UNDB v8
Expand Down
10 changes: 1 addition & 9 deletions sixtube_lm/configs/v8-4tube.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,6 @@ const byte altSel = A0; //alt select button - if unequipped, set to 0
// 1 = momentary buttons. 2 = quadrature rotary encoder.
const byte mainAdjType = 1;

// In normal running mode, what do the controls do?
// -1 = nothing/switch, -2 = cycle through functions, fn in fnsEnabled[] = go to that function
// If using soft alarm/power switch per below, the control(s) set to -1 will do the switching.
const char mainSelFn = -2;
const char mainAdjFn = -1;
const byte altSelFn = fnIsAlarm; //go straight to alarm

//What are the signal pin(s) connected to?
const char piezoPin = 10;
const char relayPin = -1;
Expand All @@ -59,8 +52,7 @@ const byte enableSoftAlarmSwitch = 1;
// 0 = no. Alarm will be permanently on. Use with switched relay if the appliance has its own switch on this relay circuit.
const byte enableSoftPowerSwitch = 1; //works with switched relay only
// 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).
// 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.
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).
// 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.

//LED circuit control
const char ledPin = -1;
Expand Down
10 changes: 1 addition & 9 deletions sixtube_lm/configs/v8-6tube.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,6 @@ const byte altSel = A0; //alt select button - if unequipped, set to 0
// 1 = momentary buttons. 2 = quadrature rotary encoder.
const byte mainAdjType = 1;

// In normal running mode, what do the controls do?
// -1 = nothing/switch, -2 = cycle through functions, fn in fnsEnabled[] = go to that function
// If using soft alarm/power switch per below, the control(s) set to -1 will do the switching.
const char mainSelFn = -2;
const char mainAdjFn = -1;
const byte altSelFn = fnIsAlarm; //go straight to alarm

//What are the signal pin(s) connected to?
const char piezoPin = 10;
const char relayPin = -1;
Expand All @@ -59,8 +52,7 @@ const byte enableSoftAlarmSwitch = 1;
// 0 = no. Alarm will be permanently on. Use with switched relay if the appliance has its own switch on this relay circuit.
const byte enableSoftPowerSwitch = 1; //works with switched relay only
// 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).
// 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.
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).
// 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.

//LED circuit control
const char ledPin = -1;
Expand Down
3 changes: 1 addition & 2 deletions sixtube_lm/configs/v8c-6tube-relayswitch-pwm-top.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ const byte enableSoftAlarmSwitch = 1;
// 0 = no. Alarm will be permanently on. Use with switched relay if the appliance has its own switch on this relay circuit.
const byte enableSoftPowerSwitch = 1; //works with switched relay only
// 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).
// 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.
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).
// 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.

//LED circuit control with PWM
const char ledPin = 9;
Expand Down
3 changes: 1 addition & 2 deletions sixtube_lm/configs/v8c-6tube-relayswitch-pwm.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ const byte enableSoftAlarmSwitch = 1;
// 0 = no. Alarm will be permanently on. Use with switched relay if the appliance has its own switch on this relay circuit.
const byte enableSoftPowerSwitch = 1; //works with switched relay only
// 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).
// 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.
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).
// 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.

//LED circuit control with PWM
const char ledPin = 9;
Expand Down
Loading

0 comments on commit 12b6c0f

Please sign in to comment.