forked from corbanmailloux/esp-mqtt-rgb-led
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge PR corbanmailloux#31, adding the unified sketch.
- Loading branch information
Showing
2 changed files
with
617 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/* | ||
* This is a sample configuration file for the "mqtt_esp8266" light. | ||
* | ||
* Change the settings below and save the file as "config.h" | ||
* You can then upload the code using the Arduino IDE. | ||
*/ | ||
|
||
// Leave this here. These are the choices for CONFIG_STRIP below. | ||
enum strip { | ||
BRIGHTNESS, // only one color | ||
RGB, // RGB LEDs | ||
RGBW // RGB LEDs with an extra white LED per LED | ||
}; | ||
|
||
#define CONFIG_STRIP RGB // Choose one of the options from above. | ||
|
||
// Pins | ||
// In case of BRIGHTNESS: only WHITE is used | ||
// In case of RGB(W): red, green, blue(, white) is used | ||
// All values need to be present, if they are not needed, set to -1, | ||
// it will be ignored. | ||
#define CONFIG_PIN_RED 0 // For RGB(W) | ||
#define CONFIG_PIN_GREEN 2 // For RGB(W) | ||
#define CONFIG_PIN_BLUE 3 // For RGB(W) | ||
#define CONFIG_PIN_WHITE -1 // For BRIGHTNESS and RGBW | ||
|
||
// WiFi | ||
#define CONFIG_WIFI_SSID "{WIFI-SSID}" | ||
#define CONFIG_WIFI_PASS "{WIFI-PASSWORD}" | ||
|
||
// MQTT | ||
#define CONFIG_MQTT_HOST "{MQTT-SERVER}" | ||
#define CONFIG_MQTT_USER "{MQTT-USERNAME}" | ||
#define CONFIG_MQTT_PASS "{MQTT-PASSWORD}" | ||
#define CONFIG_MQTT_CLIENT_ID "ESP_LED" // Must be unique on the MQTT network | ||
|
||
// MQTT Topics | ||
#define CONFIG_MQTT_TOPIC_STATE "home/ESP_LED" | ||
#define CONFIG_MQTT_TOPIC_SET "home/ESP_LED/set" | ||
|
||
#define CONFIG_MQTT_PAYLOAD_ON "ON" | ||
#define CONFIG_MQTT_PAYLOAD_OFF "OFF" | ||
|
||
// Miscellaneous | ||
// Default number of flashes if no value was given | ||
#define CONFIG_DEFAULT_FLASH_LENGTH 2 | ||
// Number of seconds for one transition in colorfade mode | ||
#define CONFIG_COLORFADE_TIME_SLOW 10 | ||
#define CONFIG_COLORFADE_TIME_FAST 3 | ||
|
||
// Reverse the LED logic | ||
// false: 0 (off) - 255 (bright) | ||
// true: 255 (off) - 0 (bright) | ||
#define CONFIG_INVERT_LED_LOGIC false | ||
|
||
// Enables Serial and print statements | ||
#define CONFIG_DEBUG false |
Oops, something went wrong.