Files
wordclock/include/wordclock_constants.h
2023-08-21 20:26:38 +02:00

72 lines
2.0 KiB
C

#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 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
// EEPROM layout
typedef enum
{
ADR_NM_START_H = 0,
ADR_NM_END_H = 4,
ADR_NM_START_M = 8,
ADR_NM_END_M = 12,
ADR_BRIGHTNESS = 16,
ADR_MC_RED = 20,
ADR_MC_GREEN = 22,
ADR_MC_BLUE = 24,
EEPROM_SIZE = 30
} EepromLayout_en;
#define NEOPIXEL_PIN 5 // pin to which the NeoPixels are attached
#define BUTTON_PIN 14 // pin to which the button is attached
// Night mode
#define NIGHTMODE_START_HR 23
#define NIGHTMODE_START_MIN 0
#define NIGHTMODE_END_HR 7
#define NIGHTMODE_END_MIN 0
// Timings
#define PERIOD_ANIMATION 200
#define PERIOD_HEARTBEAT 1000
#define PERIOD_MATRIX_UPDATE 100
#define PERIOD_NIGHTMODE_CHECK 20000
#define PERIOD_NTP_UPDATE 30000
#define PERIOD_PONG 10
#define PERIOD_SNAKE 50
#define PERIOD_STATE_CHANGE 10000
#define PERIOD_TETRIS 50
#define PERIOD_TIME_VISU_UPDATE 1000
#define TIMEOUT_LEDDIRECT 5000
#define SHORT_PRESS_MS 100
#define LONG_PRESS_MS 2000
// Current limit
#define CURRENT_LIMIT_LED 2500 // limit the total current consumed by LEDs (mA)
// LED smoothing
#define DEFAULT_SMOOTHING_FACTOR 0.5
// Number of colors in colors array
#define NUM_COLORS 7
// LED matrix size
#define MATRIX_WIDTH 11
#define MATRIX_HEIGHT 11
// State machine states count
#define NUM_STATES 6
#endif /* WORDCLOCK_CONSTANTS_H */