|
4 | 4 |
|
5 | 5 | ## Operating instructions
|
6 | 6 |
|
7 |
| -[The latest operating instructions (v2.0+) can be found here.](https://github.com/clockspot/arduino-clock/releases) |
| 7 | +[The latest operating instructions (v2.0+) can be found here.](https://github.com/clockspot/arduino-clock/blob/master/INSTRUCTIONS.md) |
8 | 8 |
|
9 |
| -[Instructions for earlier versions are here.](https://github.com/clockspot/arduino-nixie/releases) |
| 9 | +[Instructions for earlier versions are here.](https://github.com/clockspot/arduino-clock/releases) |
10 | 10 |
|
11 | 11 | To see your clock’s software version, hold **Select** briefly while powering up the clock.
|
12 | 12 |
|
13 | 13 | ## About
|
14 | 14 |
|
15 |
| -**A universal digital clock codebase for Arduino.** |
| 15 | +**A universal digital clock codebase for Arduino,** maintained by [Luke](https://theclockspot.com). |
16 | 16 |
|
17 |
| -* Time of day with automatic DST change, display shutoff, and chimes. |
| 17 | +* Time of day with automatic DST change and chimes. |
18 | 18 | * Perpetual calendar with day counter and local sunrise/sunset times.
|
19 |
| -* Alarm with snooze and automatic weekday/weekend skipping. |
20 |
| -* Chronograph and timer with interval and reset options. |
21 |
| -* Signals via piezo beeper, switch (appliance timer), pulse (bell ringer), and switchable backlighting. |
22 |
| -* Supports Nixie displays of four/six digits, multiplexed in pairs via two SN74141 driver chips. |
23 |
| -* Supports LED displays of three or four MAX7219 chips (via SPI) driving 8x8 LED matrices (example). |
| 19 | +* Daily alarm with snooze and automatic weekday/weekend skipping. |
| 20 | +* Chronograph and timer with reset/interval options. |
| 21 | +* Simple control via three/four buttons, a rotary encoder, and/or an [IMU](https://en.wikipedia.org/wiki/Inertial_measurement_unit) (tilt control). |
| 22 | +* Signals via piezo beeper, switch (e.g. appliance timer), and/or pulse (e.g. bell ringer). |
| 23 | +* Supports Nixie displays of two SN74141 chips driving four/six tubes, with anti-cathode poisoning. |
| 24 | +* Supports LED displays of three/four MAX7219 chips (via SPI) driving 8x8 LED matrices ([example](https://www.amazon.com/HiLetgo-MAX7219-Arduino-Microcontroller-Display/dp/B07FFV537V/)). |
| 25 | +* Supports scheduled display dim/shutoff and switchable backlighting with optional PWM fade. |
24 | 26 | * Timekeeping can be internal, or based on a DS3231 RTC (via I2C) for reliability/accuracy.
|
25 | 27 | * Supports both AVR and SAMD Arduinos (tested on Arduino Nano and Nano 33 IoT).
|
26 |
| -* On Nano 33 IoT, supports Wi-Fi connectivity with web-based config and NTP sync. |
| 28 | +* On Nano 33 IoT, supports Wi-Fi connectivity with web-based config and automatic NTP sync. |
27 | 29 |
|
28 |
| -Originally written for [RLB Designs’](http://rlb-designs.com/) Universal Nixie Driver Board (UNDB): |
| 30 | +Written to support [RLB Designs’](http://rlb-designs.com/) Universal Nixie Driver Board (UNDB): |
29 | 31 |
|
30 | 32 | * Backlighting (PWM LED) supported on UNDB v8+
|
31 | 33 | * Switch and pulse signals supported on UNDB v9+
|
32 | 34 | * Nano 33 IoT support coming on future versions
|
33 | 35 |
|
34 |
| -[The latest release can be downloaded here.](https://github.com/clockspot/arduino-nixie/releases/latest) |
| 36 | +[The latest release can be downloaded here.](https://github.com/clockspot/arduino-clock/releases/latest) |
35 | 37 |
|
36 |
| -# Hardware configuration |
| 38 | +# Configuration, compilation, and upload |
37 | 39 |
|
38 |
| -A number of hardware-related settings are specified in a config file, so you can easily maintain multiple hardware profiles in their own config files, and include the relevant config at the top of the sketch before compiling. |
| 40 | +Various options, such as enabled functionality, RTC, display, I/O pins, timeouts, and control behaviors, are specified in a config file. This allows you to maintain multiple configs for various clock hardware profiles, and simply include the relevant config at the top of the `.ino` before compiling. Several [example configs](https://github.com/clockspot/arduino-clock/tree/master/arduino-clock/configs) are provided, and [`~sample.h`](https://github.com/clockspot/arduino-clock/blob/master/arduino-clock/configs/%7Esample.h) includes all possible options with detailed comments. |
39 | 41 |
|
40 |
| -These settings include: |
| 42 | +You may also wish to adjust the defaults for the clock’s user-configurable values, to best suit its intended use; these defaults are currently specified in the main code (`optsDef[]` for [settings](https://github.com/clockspot/arduino-clock/blob/master/INSTRUCTIONS.md#settings-menu) and `initEEPROM()` for other values). |
41 | 43 |
|
42 |
| -* **Number of digits** in the display module. Default is 6; small display adjustments are made for 4-tube clocks. |
43 |
| -* **Which functions** are enabled (calendar, alarm, etc). |
44 |
| -* **Which pins** are associated with the inputs (controls) and outputs (displays and signals). |
45 |
| - * If your clock includes LED backlighting (e.g. UNDB v8+), specifying an LED pin will enable the LED-related options in the options menu. LEDs should be connected to a PWM pin. |
46 |
| -* **What type of Up/Down controls** are equipped: pushbuttons (default) or rotary encoder (TBD). |
47 |
| -* **What type of signal outputs** are equipped: a piezo beeper (default) and/or a relay. |
48 |
| - * **Signal duration** (default 3min) and **piezo pulse duration** (default 500ms) |
49 |
| - * If your clock includes a relay (e.g. UNDB v9+), specifying a relay pin will enable the relay-related options in the options menu. You can also specify the **relay mode**: |
50 |
| - * In switched mode (default), the relay will be switched to control an appliance like a radio or lamp. If used with timer, it will switch on while timer is running (like the “sleep” function on a clock radio). If used with alarm, it will switch on when alarm trips and stay on for **relay switch duration** (default 2 hours). In this case, the **Alt** button (if equipped) will shut it off immediately, skipping snooze. This mode also enables the option for the LED backlighting, if equipped, to switch with the relay (great for a radio!). |
51 |
| - * 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). |
52 |
| -* **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 software alarm will be permanently on. |
53 |
| -* **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.) |
54 |
| -* **Various other durations** for things like scrolling speed, set function/display timeouts, short and long button holds, “hold to set faster” thresholds, etc. |
| 44 | +I use the Arduino IDE to compile and upload, due to the use of various Arduino and Arduino-oriented libraries. Make sure the relevant libraries are installed in the Library Manager, per the config in use. |
55 | 45 |
|
56 |
| -You can also set the **defaults for the options menu** (in main code, currently) to better suit the clock’s intended use. |
| 46 | +* EEPROM (Arduino) for AVR Arduinos (e.g. original Nano) |
| 47 | +* SPI (Arduino) and [LedControl](http://wayoda.github.io/LedControl) for MAX7219-based displays |
| 48 | +* [Encoder](https://github.com/PaulStoffregen/Encoder) if rotary encoder is used for Up/Down inputs |
| 49 | +* Arduino_LSM6DS3 (Arduino) if using Nano 33 IoT’s IMU for inputs |
| 50 | +* WiFiNINA and WiFiUdp (Arduino) for Wi-Fi and NTP sync support on Nano 33 IoT |
| 51 | +* Wire (Arduino) and [DS3231](https://github.com/NorthernWidget/DS3231) if using DS3231 RTC (via I2C) |
| 52 | +* [Dusk2Dawn](https://github.com/dmkishi/Dusk2Dawn) if sunrise/sunset display is enabled |
| 53 | + * Note: At this writing, for Nano 33 IoT, it’s necessary to download this library as .ZIP and [add manually](https://www.arduino.cc/en/guide/libraries#toc4), as the version in the Library Manager [is old](https://forum.arduino.cc/index.php?topic=479550.msg3852574#msg3852574) and, in my experience, will not compile for SAMD. |
57 | 54 |
|
58 |
| -## Compiling the sketch |
| 55 | +Before compiling and uploading, you will need to select the correct board, port, and (for AVR) processor in the IDE’s Tools menu. |
59 | 56 |
|
60 |
| -The author uses the Arduino IDE to compile, due to the use of various Arduino and Arduino-oriented libraries. Install them via the Library Manager as applicable (except where indicated otherwise). |
61 |
| - |
62 |
| -* Wire (Arduino) |
63 |
| -* EEPROM (Arduino) - for AVR-based Arduinos |
64 |
| -* SPI (Arduino) and [LedControl](http://wayoda.github.io/LedControl) by Eberhard Farle - for MAX7219-based displays |
65 |
| -* Arduino_LSM6DS3 (Arduino) - if using Nano 33 IoT's IMU (Inertial Measurement Unit) for inputs |
66 |
| -* WiFiNINA and WiFiUdp (Arduino) - for Nano 33 IoT Wi-Fi and NTP sync support |
67 |
| -* [DS3231](https://github.com/NorthernWidget/DS3231) by NorthernWidget - if using DS3231 for timekeeping |
68 |
| -* [Dusk2Dawn](https://github.com/dmkishi/Dusk2Dawn) by DM Kishi - if sunrise/sunset display is enabled |
69 |
| - * Note: For Nano 33 IoT, it seems necessary to download the library from source as .ZIP and [add manually](https://www.arduino.cc/en/guide/libraries#toc4), rather than add directly via the Library Manager. |
70 |
| -* [Encoder](https://github.com/PaulStoffregen/Encoder) by Paul Stoffregen - if rotary encoder is used for Up/Down inputs |
71 |
| - |
72 |
| -**To upload the sketch to your clock,** 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). |
| 57 | +* If your Arduino does not appear as a port option, you may have a clone that requires [drivers for the CH340 chipset](https://sparks.gogo.co.nz/ch340.html). |
| 58 | +* If upload fails for an ATMega328P Arduino (e.g. original Nano), try selecting/unselecting “Old Bootloader” in the processor menu. |
0 commit comments