You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: arduino-nixie/arduino-nixie.ino
+33-28Lines changed: 33 additions & 28 deletions
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,7 @@
3
3
// Written to support RLB Designs’ Universal Nixie Driver Board
4
4
// Inspired by original sketch by Robin Birtles (rlb-designs.com) and Chris Gerekos
5
5
6
+
#include<arduino.h>
6
7
#include"arduino-nixie.h";
7
8
8
9
////////// Software version //////////
@@ -15,22 +16,18 @@ const bool vDev = 1;
15
16
16
17
// These modules are used per the available hardware and features enabled in the config file.
17
18
// The disp and rtc options are mutually exclusive and define the same functions.
18
-
// Because the Arduino IDE preprocessor seems to #include without regard to #if blocks (see https://forum.arduino.cc/index.php?topic=134226.0), I don't have #ifdef blocks around these header file inclusions. Instead I simply include them all, and have #ifdef blocks around the corresponding cpp code so only the included code is compiled. It's dumb, but it works.
19
+
// Because the Arduino IDE preprocessor seems to #include without regard to #if blocks (see https://forum.arduino.cc/index.php?topic=134226.0), I don't have #ifdef blocks around these header file inclusions. Instead I simply include them all, and have #ifdef blocks around the corresponding cpp code so only the specified code is compiled. It's dumb, but it works.
19
20
20
21
#if ENABLE_DATE_RISESET //this probably doesn't work, per the above, but ¯\_(ツ)_/¯
21
22
#include<Dusk2Dawn.h>//DM Kishi - unlicensed - install in your Arduino IDE if needed - test without
22
23
#endif
23
-
#include"storage.h"; //supports both AVR EEPROM and SAMD flash
24
-
#include"dispNixie.cpp"//for a SN74141-multiplexed nixie array
25
-
#include"dispMAX7219.cpp"//for a SPI MAX7219 8x8 LED array
26
-
27
-
#include"rtcDS3231.h"//for an I2C DS3231 RTC module
28
-
#include"rtcMillis.h"//for a fake RTC based on millis
//Temporary-display function timeout: if we're *not* in a permanent one (time, or running/signaling timer)
844
841
// Stopped/non-signaling timer shouldn't be permanent, but have a much longer timeout, mostly in case someone is waiting to start the chrono in sync with some event, so we'll give that an hour.
//The sun and weather displays are based on a snapshot of the time of day when the function display was triggered, just in case it's triggered a few seconds before a sun event (sunrise/sunset) and the "prev/now" and "next" displays fall on either side of that event, they'll both display data from before it. If triggered just before midnight, the date could change as well – not such an issue for sun, but might be for weather - TODO create date snapshot also
unsignedlong inputLast = 0; //When an input last took place, millis()
66
71
int inputLastTODMins = 0; //When an input last took place, time of day. Used in paginated functions so they all reflect the time of day when the input happened.
67
72
68
-
voidinitInputs(){
73
+
boolinitInputs(){
69
74
//TODO are there no "loose" pins left floating after this? per https://electronics.stackexchange.com/q/37696/151805
70
75
#ifdef INPUT_BUTTONS
71
76
pinMode(CTRL_SEL, INPUT_PULLUP);
@@ -85,6 +90,10 @@ void initInputs(){
85
90
IMU.begin();
86
91
//Serial.println(F("IMU initialized"));
87
92
#endif
93
+
//Check to see if CTRL_SEL is held at init - facilitates version number display and EEPROM hard init
94
+
delay(100); //prevents the below from firing in the event there's a capacitor stabilizing the input, which can read low falsely
0 commit comments