Skip to content

Commit 737d457

Browse files
committed
v8a/b configs: rename to reflect PWM change; include version with sel/alt flipped
1 parent 03c7f19 commit 737d457

File tree

3 files changed

+101
-0
lines changed

3 files changed

+101
-0
lines changed
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
//v8 with B style modification, and flipped Sel and Alt buttons so Sel is in the front when buttons are mounted display-side with IN-8-A display
2+
3+
const byte displaySize = 6; //number of tubes in display module. Small display adjustments are made for 4-tube clocks
4+
5+
// available clock functions, and unique IDs (between 0 and 200)
6+
const byte fnIsTime = 0;
7+
const byte fnIsDate = 1;
8+
const byte fnIsAlarm = 2;
9+
const byte fnIsTimer = 3;
10+
const byte fnIsDayCount = 4;
11+
const byte fnIsTemp = 5;
12+
const byte fnIsTubeTester = 6; //cycles all digits on all tubes 1/second, similar to anti-cathode-poisoning cleaner
13+
// functions enabled in this clock, in their display order. Only fnIsTime is required
14+
const byte fnsEnabled[] = {fnIsTime, fnIsDate, fnIsAlarm, fnIsTimer, fnIsDayCount}; //, fnIsTemp, fnIsTubeTester
15+
// To control which of these display persistently vs. switch back to Time after a few seconds, search "Temporary-display mode timeout"
16+
17+
// These are the RLB board connections to Arduino analog input pins.
18+
// S1/PL13 = Reset
19+
// S2/PL5 = A1
20+
// S3/PL6 = A0
21+
// S4/PL7 = A6
22+
// S5/PL8 = A3
23+
// S6/PL9 = A2
24+
// S7/PL14 = A7
25+
// 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.
26+
27+
// What input is associated with each control?
28+
const byte mainSel = A7; //main select button - must be equipped
29+
const byte mainAdjUp = A0; //main up/down buttons or rotary encoder - must be equipped
30+
const byte mainAdjDn = A1;
31+
const byte altSel = A6; //alt select button - if unequipped, set to 0
32+
33+
// What type of adj controls are equipped?
34+
// 1 = momentary buttons. 2 = quadrature rotary encoder.
35+
const byte mainAdjType = 1;
36+
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+
44+
//What are the signal pin(s) connected to?
45+
const char piezoPin = 10;
46+
const char relayPin = A3;
47+
// -1 to disable feature (no relay item equipped); A3 if equipped (UNDB v8)
48+
const byte relayMode = 0; //If relay is equipped, what does it do?
49+
// 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 switchDur.
50+
// 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 relayPulse.
51+
const word signalDur = 180; //sec - when pulsed signal is going, pulses are sent once/sec for this period (e.g. 180 = 3min)
52+
const word switchDur = 7200; //sec - when alarm triggers switched relay, it's switched on for this period (e.g. 7200 = 2hr)
53+
const word piezoPulse = 500; //ms - used with piezo via tone()
54+
const word relayPulse = 200; //ms - used with pulsed relay
55+
56+
//Soft power switches
57+
const byte enableSoftAlarmSwitch = 1;
58+
// 1 = yes. Alarm can be switched on and off when clock is displaying the alarm time (fnIsAlarm).
59+
// 0 = no. Alarm will be permanently on. Use with switched relay if the appliance has its own switch on this relay circuit.
60+
const byte enableSoftPowerSwitch = 1; //works with switched relay only
61+
// 1 = yes. Relay can be switched on and off directly when clock is displaying time of day (fnIsTime). 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+
64+
//LED circuit control with PWM
65+
const char ledPin = 11;
66+
// -1 to disable feature; 11 if equipped (UNDB v8 modded)
67+
68+
//When display is dim/off, a press will light the tubes for how long?
69+
const byte unoffDur = 10; //sec
70+
71+
// How long (in ms) are the button hold durations?
72+
const word btnShortHold = 1000; //for setting the displayed feataure
73+
const word btnLongHold = 3000; //for for entering options menu
74+
const byte velThreshold = 150; //ms
75+
// When an adj up/down input (btn or rot) follows another in less than this time, value will change more (10 vs 1).
76+
// Recommend ~150 for rotaries. If you want to use this feature with buttons, extend to ~400.
77+
78+
// What is the "frame rate" of the tube cleaning and display scrolling? up to 65535 ms
79+
const word cleanSpeed = 200; //ms
80+
const word scrollSpeed = 100; //ms - e.g. scroll-in-and-out date at :30 - to give the illusion of a slow scroll that doesn't pause, use (timeoutTempFn*1000)/(displaySize+1) - e.g. 714 for displaySize=6 and timeoutTempFn=5
81+
82+
// What are the timeouts for setting and temporarily-displayed functions? up to 65535 sec
83+
const unsigned long timeoutSet = 120; //sec
84+
const unsigned long timeoutTempFn = 5; //sec
85+
86+
//This clock is 2x3 multiplexed: two tubes powered at a time.
87+
//The anode channel determines which two tubes are powered,
88+
//and the two SN74141 cathode driver chips determine which digits are lit.
89+
//4 pins out to each SN74141, representing a binary number with values [1,2,4,8]
90+
const char outA1 = 2;
91+
const char outA2 = 3;
92+
const char outA3 = 4;
93+
const char outA4 = 5;
94+
const char outB1 = 6;
95+
const char outB2 = 7;
96+
const char outB3 = 8;
97+
const char outB4 = 9;
98+
//3 pins out to anode channel switches
99+
const char anode1 = 16; //A2 - was 11 before PWM fix
100+
const char anode2 = 12;
101+
const char anode3 = 13;

0 commit comments

Comments
 (0)