Skip to content

Commit 91c14f4

Browse files
authored
Merge pull request #10 from clockspot/dev
Dev
2 parents 4e58a5d + 43bf05e commit 91c14f4

38 files changed

+3936
-1952
lines changed

INSTRUCTIONS.md

+156
Large diffs are not rendered by default.

README.md

+60-161
Large diffs are not rendered by default.

TODO.md

+19-13
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,28 @@
11
# To-dos
22

3-
* Timer count up, ending options - maybe separate chrono and timer à la Timex?
4-
* Different setting option for pushbutton (à la Timex) vs. rotary (à la microwave ovens) - external file?
3+
* Startup SEL hold doesn't seem to work with IMU
4+
* Reintroduce nixie clean and scroll
5+
* Persistent storage on EEPROM - find a solution that writes to flash less often
6+
* Network/NTP
7+
* Why does the page sometimes drop?
8+
* wi-fi credential save fails if keys are part of the string?
9+
* DST calc may behave unpredictably between 1–2am on fallback day
10+
* Redo NTP if it failed (networkStartWifi()) - per bad response - how to make it wait a retry period
11+
* Make [2036-ready](https://en.wikipedia.org/wiki/Year_2038_problem#Network_Time_Protocol_timestamps)
12+
* Notice when a leap second is coming and handle it
13+
* When setting page is used to set day counter and date, and the month changes, set date max. For 2/29 it should just do 3/1 probably.
14+
* Weather support
15+
* Stop using strings? There is plenty of RAM available on SAMD I think
16+
* Input: support other IMU orientations
17+
* When day counter is set to count up from 12/31, override to display 365/366 on that date
18+
* Bitmask to enable/disable features?
519
* Option to display weekdays as Sun=0 or Sun=1 (per Portuguese!)
6-
* When setting times of day, make 1439 (minutes) roll over to 0 and vice versa
7-
* Implement options for full date every 5 minutes
820
* Is it possible to trip the chime *after* determining if we're in night shutoff or not
9-
* Reenable rotary encoder with libraries with workable licenses
1021
* In display code, consider using `delayMicroseconds()` which, with its tighter resolution, may give better control over fades and dim levels
11-
* in `checkInputs()`, can all this if/else business be defined at load instead of evaluated every sample? OR is it compiled that way? maybe use `#ifdef`
1222
* in `ctrlEvt()`, could we do release/shorthold on mainSel so we can exit without making changes?
13-
* Should functions be modular in the code, and have a reserved memory location / 100 per each?
14-
* Should functions have their own options menu?
15-
* I2C display to help with setting?
16-
* I2C multicolor LED to indicate which function we're in?
17-
* Metronome function
18-
* Alarm option should be beeping patterns, including a slow wake which defeats the 2 minute delay
19-
* Signalstart should create a situation where there's time on the counter, but doesn't make sound since the rtc can do that. Other beepable actions would probably cancel that counter anyway
23+
* I2C multicolor LED to indicate which function we're in? - possibly as part of display
24+
* Metronome function?
25+
* Signalstart should create a situation where there's time on the counter, but doesn't make sound since the rtc can do that. Other beepable actions would probably cancel that counter anyway (is this still applicable?)
2026
* Why does the display flicker sometimes? are we doubling up on a display cycle call?
2127

2228
See other TODOs throughout code.

arduino-clock/arduino-clock.h

+81
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
#ifndef ARDUINO_CLOCK_H
2+
#define ARDUINO_CLOCK_H
3+
4+
////////// Hardware configuration //////////
5+
//Include the config file that matches your hardware setup. If needed, duplicate an existing one.
6+
7+
#include "configs/undb-v9.h"
8+
9+
////////////////////////////////////////////
10+
11+
12+
//Unique IDs for the functions - see also fnScroll
13+
#define FN_TOD 0 //time of day
14+
#define FN_CAL 1 //date, with optional day counter and sunrise/sunset pages
15+
#define FN_ALARM 2 //alarm time
16+
#define FN_TIMER 3 //countdown timer and chronograph
17+
#define FN_THERM 4 //temperature per rtc – will likely read high
18+
#define FN_TUBETEST 5 //simply cycles all digits for nixie tube testing
19+
#define FN_OPTS 201 //fn values from here to 255 correspond to settings in the settings menu
20+
21+
void setup();
22+
void loop();
23+
void ctrlEvt(byte ctrl, byte evt, byte evtLast, bool velocity=0);
24+
void fnScroll(byte dir);
25+
void fnOptScroll(byte dir);
26+
void goToFn(byte thefn, byte thefnPg=0);
27+
void switchAlarmState(byte dir);
28+
void setAlarmState(byte state);
29+
byte getAlarmState();
30+
void switchPower(byte dir);
31+
void startSet(int n, int m, int x, byte p);
32+
void doSet(int delta);
33+
void clearSet();
34+
bool initEEPROM(bool hard);
35+
void findFnAndPageNumbers();
36+
void checkRTC(bool force);
37+
void fibonacci(byte h, byte m, byte s);
38+
void autoDST();
39+
bool isDST(int y, byte m, byte d);
40+
bool isDSTByHour(int y, byte m, byte d, byte h, bool setFlag);
41+
byte nthSunday(int y, byte m, byte nth);
42+
byte daysInMonth(word y, byte m);
43+
int daysInYear(word y);
44+
int dateToDayCount(word y, byte m, byte d);
45+
byte dayOfWeek(word y, byte m, byte d);
46+
int dateComp(int y, byte m, byte d, byte mt, byte dt, bool countUp);
47+
bool isTimeInRange(word tstart, word tend, word ttest);
48+
bool isDayInRange(byte dstart, byte dend, byte dtest);
49+
void millisCheckDrift();
50+
void millisApplyDrift();
51+
void millisReset();
52+
unsigned long ms();
53+
void timerStart();
54+
void timerStop();
55+
void timerClear();
56+
void timerLap();
57+
void timerRunoutToggle();
58+
void cycleTimer();
59+
void timerSleepSwitch(bool on);
60+
byte getTimerState();
61+
void setTimerState(char pos, bool val);
62+
void tempDisplay(int i0, int i1=0, int i2=0, int i3=0);
63+
void updateDisplay();
64+
void calcSun();
65+
void displaySun(byte which, int d, int tod);
66+
void displayWeather(byte which);
67+
void initOutputs();
68+
void signalStart(byte sigFn, byte sigDur);
69+
void signalStop();
70+
void cycleSignal();
71+
word getSignalPitch();
72+
word getHz(byte note);
73+
byte getSignalOutput();
74+
byte getSignalPattern();
75+
void quickBeep(int pitch);
76+
void quickBeepPattern(int source, int pattern);
77+
void updateBacklight();
78+
void cycleBacklight();
79+
byte getVersionPart(byte part);
80+
81+
#endif //ARDUINO_CLOCK_H

0 commit comments

Comments
 (0)