2019-06-05 04:29:47 +00:00
# pragma once
2019-05-30 11:11:42 +00:00
# include <Arduino.h>
2019-05-30 11:15:21 +00:00
# define FASTLED_INTERNAL
# include <FastLED.h>
2019-05-30 11:11:42 +00:00
2019-06-12 18:48:20 +00:00
//#define DEBUG // Uncomment this to enable Debug messages via Serial and, if enabled, MQTT.
2019-06-06 04:41:11 +00:00
//#define CONFIG_USABLE // Uncomment this by removing the // at the beginning!
2019-05-23 19:18:15 +00:00
2019-06-12 18:48:20 +00:00
# define WIFI_SSID "..." // SSID of the wifi to connect to
# define WIFI_PASS "..." // Password of the wifi
2019-05-21 03:52:57 +00:00
2019-06-12 18:48:20 +00:00
# define LED_WIDTH 16 // Number of LEDs in horizontal direction
# define LED_HEIGHT 16 // Number of LEDs in vertical direction
# define LED_COUNT 256 // Total number of LEDs. WIDTH*HEIGHT.
# define LED_TYPE WS2812B // Type of LEDs
# define DATA_PIN 14 // PIN the LEDs are connected to on the microcontroller
# define COLOR_ORDER GRB // Order of the colors of the LEDs. If you get unexpected colors, you should change this.
# define BRIGHTNESS 20 // Default brightness of the LEDs. 1 (lowest)-255 (brightest)
# define TEMPORAL_DITHERING 0 // Use temporal dithering. Can lead to flickering.
2019-06-12 18:48:56 +00:00
# define LED_MAX_MILLIAMPS 0 // If your power supply is too small, you can set this to a maximum mA value. FastLED should then honor this. Setting it to 0 disables this limit.
2019-05-21 03:52:57 +00:00
2019-06-12 18:48:20 +00:00
# define NTP_SERVER "pool.ntp.org" // NTP server to use to fetch the current time
# define NTP_INTERVAL 300000 // Interval in ms to update the time from the NTP server. 300000 ms = 5 minutes
# define NTP_OFFSET 7200 // Offset of your local time from UTC in seconds. Germany, daylight savings time = 2 hours = 7200 seconds
2019-05-21 03:52:57 +00:00
2019-06-12 18:57:31 +00:00
# define HTTP_SERVER_ENABLE
# define HTTP_SERVER_PORT 80
2019-06-12 18:48:20 +00:00
# define MQTT_ENABLE // Use MQTT. Add slashes to the start of the line to disable MQTT completely.
# define MQTT_SERVER "..." // Data for connecting to the MQTT server
2019-05-21 03:52:57 +00:00
# define MQTT_PORT 1883
2019-05-30 11:11:42 +00:00
# define MQTT_USER "..."
# define MQTT_PASS "..."
2019-06-12 18:48:20 +00:00
# define MQTT_TOPIC "pitrix / " // MQTT topic to listen to. Must not start with a slash, but must end with one.
# define MQTT_REPORT_METRICS // Whether to report metrics via MQTT. Disable if unwanted.
2019-06-07 04:30:15 +00:00
# define MQTT_TOPIC_WEATHER "accuweather / pitrix / " // MQTT topic to listen for weather data. Must not start with a slash, but must end with one.
2019-05-21 03:52:57 +00:00
2019-06-12 18:48:20 +00:00
# define HOSTNAME "pitrix-%08X" // Hostname of the ESP to use for OTA and MQTT client id. %08X will be replaced by the chip id.
# define OTA_STARTUP_DELAY 10 // How many seconds to wait at startup. This is useful to prevent being unable to flash OTA by a bug in the code. Set to 0 to disable.
2019-05-21 03:52:57 +00:00
# define FPS 50
# define SHOW_TEXT_DELAY 100
2019-05-27 16:13:01 +00:00
2019-09-04 04:05:45 +00:00
# define RECORDER_ENABLE
# define RECORDER_PORT 2122
2019-05-27 16:13:17 +00:00
# define MONITOR_LOOP_TIMES false
# define MONITOR_LOOP_TIME_THRESHOLD 500
# define MONITOR_LOOP_TIME_COUNT_MAX 10
2019-05-30 11:11:42 +00:00
# define EFFECT_CYCLE_TIME 300 // Time in seconds between cycling effects.
2019-06-18 16:12:36 +00:00
# define EFFECT_CYCLE_RANDOM true
2019-05-30 11:11:42 +00:00
# define EFFECT_MATRIX_LENGTH_MIN 4
# define EFFECT_MATRIX_LENGTH_MAX 20
# define EFFECT_MATRIX_SPEED_MIN 50
# define EFFECT_MATRIX_SPEED_MAX 135
2019-06-12 04:32:06 +00:00
# define EFFECT_SINGLE_DYNAMIC_LOOP_TIME 40
2019-05-30 11:11:42 +00:00
# define EFFECT_MULTI_DYNAMIC_LOOP_TIME 1400
2019-06-19 20:31:11 +00:00
# define EFFECT_BIG_DYNAMIC_LOOP_TIME 50
# define EFFECT_BIG_DYNAMIC_SIZE 3
2019-05-30 11:11:42 +00:00
# define EFFECT_CONFETTI_PIXELS_PER_LOOP 2
2019-05-27 16:13:01 +00:00
2019-05-31 03:45:07 +00:00
# define EFFECT_SNAKE_DIRECTION_CHANGE 10
# define EFFECT_SNAKE_SLOWDOWN 2
2019-06-04 03:58:23 +00:00
# define EFFECT_FIRE_COOLDOWN 192
# define EFFECT_FIRE_SPARK_CHANCE 5
2019-06-06 04:41:11 +00:00
# define EFFECT_FIREWORK_SHOT_CHANCE 200
# define EFFECT_FIREWORK_BLUR 200
# define EFFECT_FIREWORK_FADEOUT_SPEED 5
2019-06-07 04:24:16 +00:00
2019-06-14 03:37:35 +00:00
# define EFFECT_GOL_START_PERCENTAGE 90
# define EFFECT_GOL_BLEND_SPEED 10
# define EFFECT_GOL_RESTART_AFTER_STEPS 100
2019-06-18 16:13:37 +00:00
2019-06-19 20:31:11 +00:00
# define EFFECT_DVD_WIDTH 3
# define EFFECT_DVD_HEIGHT 2
2019-06-05 04:29:47 +00:00
// Stop editing here
2019-05-30 11:11:42 +00:00
# ifdef DEBUG
2019-06-07 04:24:16 +00:00
# ifdef MQTT_ENABLE
# include "my_mqtt.h"
2019-06-18 16:13:37 +00:00
# define LOG(msg, ...) do { \
char buffer [ 128 ] ; \
snprintf_P ( buffer , 128 , PSTR ( msg ) , # # __VA_ARGS__ ) ; \
mqtt_log ( buffer ) ; \
Serial . print ( buffer ) ; \
} while ( 0 ) ;
# define LOGln(msg, ...) do {\
char buffer [ 128 ] ; \
snprintf_P ( buffer , 128 , PSTR ( msg ) , # # __VA_ARGS__ ) ; \
mqtt_log_ln ( buffer ) ; \
Serial . println ( buffer ) ; \
} while ( 0 ) ;
2019-06-07 04:24:16 +00:00
# else
2019-06-18 16:13:37 +00:00
# define LOG(msg, ...) do { \
char buffer [ 128 ] ; \
snprintf_P ( buffer , 128 , PSTR ( msg ) , # # __VA_ARGS__ ) ; \
Serial . print ( buffer ) ; \
} while ( 0 ) ;
# define LOGln(msg, ...) do { \
char buffer [ 128 ] ; \
snprintf_P ( buffer , 128 , PSTR ( msg ) , # # __VA_ARGS__ ) ; \
Serial . println ( buffer ) ; \
} while ( 0 ) ;
2019-06-07 04:24:16 +00:00
# endif
2019-05-30 11:11:42 +00:00
# else
2019-06-18 16:13:37 +00:00
# define LOG(msg, ...) do {} while(0);
# define LOGln(msg, ...) do {} while(0);
2019-05-30 11:11:42 +00:00
# endif
2019-06-06 04:41:11 +00:00
2019-06-07 04:30:38 +00:00
# if !defined( ESP8266 ) && !defined( ESP32 )
# error "Neither ESP8266 nor ESP32 are set. Maybe you are compiling this for another platform...?"
# endif
2019-06-06 04:41:11 +00:00
# ifndef CONFIG_USABLE
2019-06-07 04:24:16 +00:00
# error "CONFIG_USABLE isn't set!"
2019-06-06 04:41:11 +00:00
# endif