diff --git a/lib/treppe/treppe.cpp b/lib/treppe/treppe.cpp index 6f1860f..f001e40 100644 --- a/lib/treppe/treppe.cpp +++ b/lib/treppe/treppe.cpp @@ -303,6 +303,11 @@ void Treppe::setup() pwmController.setPWMFrequency(100); //pwmController.setAllChannelsPWM(idle_pwm); + pinMode(13, OUTPUT); + pinMode(0, OUTPUT); + digitalWrite(13, HIGH); + digitalWrite(0, HIGH); + pinMode(A0, INPUT); pinMode(SENSOR_OBEN, INPUT); pinMode(SENSOR_UNTEN, INPUT); diff --git a/lib/treppe/treppe.h b/lib/treppe/treppe.h index ec5bb4d..f9ab0c2 100644 --- a/lib/treppe/treppe.h +++ b/lib/treppe/treppe.h @@ -21,7 +21,7 @@ private: uint16_t idle_pwm_max = 100; uint16_t idle_pwm_ist = idle_pwm_max; uint16_t idle_pwm_soll = 0; - uint16_t active_pwm = 700; + uint16_t active_pwm = 2000; uint16_t ldr_schwelle = 2; // activation value for FSM [lx] struct fsm_pending_inputs_t { diff --git a/src/main.cpp b/src/main.cpp index ed7b025..0cf9a09 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -12,6 +12,7 @@ extern "C" { #include "httpserver.h" #include "ota.h" #include "wifi_credentials.h" +#include // BOARD #define ESP12_LED 2 @@ -34,6 +35,11 @@ uint32_t _t=0; #define SP_US(_str,_a) Serial.print(_str); Serial.print(" took: "); Serial.print(_a); Serial.println("us") #define TIMEIF_US(_f, _l, _str) _t=micros(); _f; _t=micros()-_t; if(_t > (_l)) { SP_US(_str, _t); } +struct { // Struct for wifi-data, 40 Bytes each SSID and PW + char SSID[40] = ""; + char PW[40] = ""; + } wifi_data; + void timerCallback(void *pArg) { @@ -57,6 +63,14 @@ void setup() { Serial.println("Booting ...."); pinMode(ESP12_LED, OUTPUT); + EEPROM.begin(512); // init virtual "EEPROM" with size 512 Bytes + + //strncpy(wifi_data.SSID, "donotconnect", 40); + //strncpy(wifi_data.PW, "unsafe lol", 40); + + EEPROM.get(0, wifi_data); + //EEPROM.commit(); + Wire.begin(); // Wire must be started first Wire.setClock(1000000); // Supported baud rates are 100kHz, 400kHz, and 1000kHz stairs.setup(); @@ -87,6 +101,8 @@ void setup() { os_timer_setfn(&timer1, timerCallback, &timer_flag); os_timer_arm(&timer1, 20, true); + + Serial.println("SSID: " + String(wifi_data.SSID) + " PW: " + String(wifi_data.PW)); } uint32_t c = 0;