reorganzie main

This commit is contained in:
Simon Schmidt 2021-06-24 19:46:24 +02:00
parent a400b0464d
commit 2b2a135bd5
2 changed files with 6 additions and 8 deletions

View File

@ -1,6 +1,10 @@
#ifndef __OTA_H
#define __OTA_H
#include <ESP8266WiFi.h>
#include <WiFiUdp.h>
#include <ArduinoOTA.h>
void ota_setup() {
ArduinoOTA.setPort(8266);
ArduinoOTA.setHostname("ESP_Treppenlicht");

View File

@ -9,11 +9,7 @@ extern "C" {
#include "user_interface.h"
}
// OTA & WEB
#include <ESP8266WiFi.h>
#include <WiFiUdp.h>
#include <ArduinoOTA.h>
#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,6 +75,7 @@ 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);