Initial commit
This commit is contained in:
79
include/wordclock_constants.h
Normal file
79
include/wordclock_constants.h
Normal file
@@ -0,0 +1,79 @@
|
||||
#ifndef WORDCLOCK_CONSTANTS_H
|
||||
#define WORDCLOCK_CONSTANTS_H
|
||||
|
||||
#include <Arduino.h>
|
||||
|
||||
// ----------------------------------------------------------------------------------
|
||||
// CONSTANTS
|
||||
// ----------------------------------------------------------------------------------
|
||||
#define AP_SSID "WordclockAP" // SSID name of Access Point
|
||||
#define NTP_SERVER_URL "de.pool.ntp.org" // NTP server address
|
||||
#define MY_TZ "CET-1CEST-2,M3.5.0/02:00:00,M10.5.0/03:00:00" // Timezone
|
||||
|
||||
#define HOSTNAME (String("wordclock")) // Local hostname
|
||||
#define LOGGER_MULTICAST_IP (IPAddress(230, 120, 10, 2)) // IP for UDP server
|
||||
#define LOGGER_MULTICAST_PORT (8123) // Port for UDP server
|
||||
#define HTTP_PORT (80) // Standard HTTP port
|
||||
|
||||
// ESP8266 Pins
|
||||
#define FASTLED_PIN (0) // pin to which the LEDs are attached
|
||||
#define BUTTON_PIN (5) // pin to which the button is attached
|
||||
|
||||
// Time limits
|
||||
#define HOUR_MAX (23)
|
||||
#define MINUTE_MAX (59)
|
||||
|
||||
#define MINUTES_IN_HOUR (60)
|
||||
#define HOURS_IN_DAY (24)
|
||||
|
||||
// Night mode
|
||||
#define NIGHTMODE_START_HR (23)
|
||||
#define NIGHTMODE_START_MIN (0)
|
||||
#define NIGHTMODE_END_HR (7)
|
||||
#define NIGHTMODE_END_MIN (0)
|
||||
|
||||
// Timings in us
|
||||
#define PERIOD_ANIMATION_US (200 * 1000) // 200ms
|
||||
#define PERIOD_CLOCK_UPDATE_US (1 * 1000 * 1000) // Must be 1s! Do not change!
|
||||
#define PERIOD_HEARTBEAT_US (1 * 1000 * 1000) // 1s
|
||||
#define PERIOD_MATRIX_UPDATE_US (33 * 1000) // 33ms
|
||||
#define PERIOD_NIGHTMODE_CHECK_US (30 * 1000 * 1000) // 30s
|
||||
#define PERIOD_TIME_UPDATE_US (1 * 1000 * 1000) // 1000ms
|
||||
#define PERIOD_PONG_US (10 * 1000) // 10ms
|
||||
#define PERIOD_SNAKE_US (50 * 1000) // 50ms
|
||||
#define PERIOD_STATE_CHANGE_US (10 * 1000 * 1000) // 10s
|
||||
#define PERIOD_TETRIS_US (50 * 1000) // 50ms
|
||||
#define TIMEOUT_LEDDIRECT_US (5 * 1000 * 1000) // 5s
|
||||
#define PERIOD_BRIGHTNESS_UPDATE_US (5 * 60 * 1000 * 1000) // 300s
|
||||
|
||||
#define SHORT_PRESS_US (100 * 1000) // 100ms
|
||||
#define LONG_PRESS_US (2 * 1000 * 1000) // 2s
|
||||
#define VERY_LONG_PRESS_US (10 * 1000 * 1000) // 10s
|
||||
|
||||
// Current limit
|
||||
#define CURRENT_LIMIT_LED (2500) // limit the total current consumed by LEDs (mA)
|
||||
|
||||
// Brightness ranges range: 0 - 255
|
||||
#define DEFAULT_BRIGHTNESS (40)
|
||||
#define MIN_BRIGHTNESS (10)
|
||||
#define MAX_BRIGHTNESS UINT8_MAX
|
||||
|
||||
// LED smoothing
|
||||
#define DEFAULT_SMOOTHING_FACTOR (0.5f)
|
||||
|
||||
// Number of colors in colors array
|
||||
#define NUM_COLORS (7)
|
||||
#define COLOR_ORDER GRB // WS2812B color order
|
||||
|
||||
// LED matrix size
|
||||
#define MATRIX_WIDTH (11)
|
||||
#define MATRIX_HEIGHT (11)
|
||||
#define NUM_MATRIX (MATRIX_WIDTH * (MATRIX_HEIGHT + 1))
|
||||
|
||||
// NTP macros TODO
|
||||
#define BUILD_YEAR (__DATE__ + 7) // Will expand to current year at compile time as string.
|
||||
#define NTP_MINIMUM_RX_YEAR (atoi(BUILD_YEAR) - 1) // Will expand to current year minus one at compile time.
|
||||
#define NTP_START_YEAR (1900) // NTP minimum year is 1900
|
||||
#define NTP_MAX_OFFLINE_TIME_S (7 * 24 * 3600) // Watchdog value, maximum offline time before a restart is triggered
|
||||
|
||||
#endif /* WORDCLOCK_CONSTANTS_H */
|
||||
Reference in New Issue
Block a user