Skip to content

Commit

Permalink
Add unified sketch
Browse files Browse the repository at this point in the history
  • Loading branch information
r41d committed Sep 5, 2017
1 parent 318d6d5 commit 0d7b316
Show file tree
Hide file tree
Showing 2 changed files with 607 additions and 0 deletions.
55 changes: 55 additions & 0 deletions mqtt_esp8266/config-sample.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/*
* 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.
*/

// Define the strip type
enum strip { BRIGHTNESS // only one color
, RGB // RGB LEDs
, RGBW // RGB LEDs with an extra white LED per LED
};
#define CONFIG_STRIP RGB

// Pins
// In case of BRIGHTNESS: only RED is used
// In case of RGB(W): red, green, blue(, white) is used
// All values need to be present, if they are not needed, just write any value,
// it will be ignored.
#define CONFIG_PIN_RED 0
#define CONFIG_PIN_GREEN 2 // only needed for RGB(W) strips
#define CONFIG_PIN_BLUE 3 // only needed for RGB(W) strips
#define CONFIG_PIN_WHITE 4 // only needed for RGBW strips

// 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
Loading

0 comments on commit 0d7b316

Please sign in to comment.