From c4eafa227a4860d0ca8de0040dc2589519df541d Mon Sep 17 00:00:00 2001 From: Kekskurse Date: Fri, 17 Jan 2020 17:07:34 +0100 Subject: [PATCH] YoLo --- .gitignore | 1 + include/config.h.example | 8 ++++++++ include/fade.h | 1 + src/main.cpp | 13 ++----------- 4 files changed, 12 insertions(+), 11 deletions(-) create mode 100644 include/config.h.example diff --git a/.gitignore b/.gitignore index 89cc49c..9015bfe 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ .vscode/c_cpp_properties.json .vscode/launch.json .vscode/ipch +include/config.h \ No newline at end of file diff --git a/include/config.h.example b/include/config.h.example new file mode 100644 index 0000000..35e139e --- /dev/null +++ b/include/config.h.example @@ -0,0 +1,8 @@ +#define MQTT_TOPIC_START "led1" +#define MQTT_USER "" +#define MQTT_PASS "" +#define MQTT_BROKER "mqtt.example.com" +#define MQTT_CLIENT_ID "LED-Schrank-1" + +const char* SSID = "WIFISSID"; +const char* PSK = "WIFIPASS"; diff --git a/include/fade.h b/include/fade.h index 034ff62..20d63bf 100644 --- a/include/fade.h +++ b/include/fade.h @@ -1,4 +1,5 @@ #include +#define foo "BAR" void fade(LEDStripe* led); \ No newline at end of file diff --git a/src/main.cpp b/src/main.cpp index e9d50a0..fe4db79 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #define REDPIN1 5 #define GREENPIN1 4 @@ -12,22 +13,11 @@ #define GREENPIN2 14 #define BLUEPIN2 16 -#define MQTT_TOPIC_START "led1" -#define MQTT_USER "" -#define MQTT_PASS "" -#define MQTT_BROKER "mqtt.example.com" -#define MQTT_CLIENT_ID "LED-Schrank-1" - -const char* SSID = "WIFISSID"; -const char* PSK = "WIFIPASS"; WiFiClient espClient; PubSubClient client(espClient); - - - int Sync = 0; //Sync LED2 on the value of LED1 LEDStripe led1 = {0, 0, 5000, 0, 0, 0, 0, 0, 0}; @@ -243,6 +233,7 @@ void prepareMQTT() { void setup() { Serial.begin(115200); + Serial.println(foo); pinMode(LED_BUILTIN, OUTPUT); Serial.println(); Serial.println("Start LED-Controller");