From 2b2a135bd529f3b12ac0875339513b0ae1d8f701 Mon Sep 17 00:00:00 2001 From: Simon Schmidt Date: Thu, 24 Jun 2021 19:46:24 +0200 Subject: [PATCH] reorganzie main --- include/ota.h | 4 ++++ src/main.cpp | 10 ++-------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/include/ota.h b/include/ota.h index 8df0413..55737d2 100644 --- a/include/ota.h +++ b/include/ota.h @@ -1,6 +1,10 @@ #ifndef __OTA_H #define __OTA_H +#include +#include +#include + void ota_setup() { ArduinoOTA.setPort(8266); ArduinoOTA.setHostname("ESP_Treppenlicht"); diff --git a/src/main.cpp b/src/main.cpp index 16d937d..c77f429 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -9,11 +9,7 @@ extern "C" { #include "user_interface.h" } // OTA & WEB -#include -#include -#include #include "ota.h" - #include "wifi_credentials.h" #include "httpserver.h" @@ -22,14 +18,11 @@ extern "C" { #define NODEMCU_LED 16 // PWM - #include "pwm.h" os_timer_t timer1; uint8_t timer_flag = 0; - Treppe stairs(13); - // WIFI const char* ssid = STASSID; const char* password = STAPSK; @@ -82,7 +75,8 @@ void setup() { pinMode(ESP12_LED, OUTPUT); Wire.begin(); // Wire must be started first - + Wire.setClock(1000000); // Supported baud rates are 100kHz, 400kHz, and 1000kHz + WiFi.mode(WIFI_STA); WiFi.begin(ssid, password);