diff --git a/lib/treppe/treppe.cpp b/lib/treppe/treppe.cpp index 9cb1e85..4496ff2 100644 --- a/lib/treppe/treppe.cpp +++ b/lib/treppe/treppe.cpp @@ -112,12 +112,12 @@ bool Treppe::read_sensor(int sensor) { /* - reads sensors with edge detection - - returns true if motion was detected - returns false if no motion was detected - returns false if motion was detected, but state did not change back to not detected - */ + reads sensors with edge detection + + returns true if motion was detected + returns false if no motion was detected + returns false if motion was detected, but state did not change back to not detected + */ uint8_t pegel = digitalRead(sensor); static uint8_t pegel_alt[2] = {0, 0}; diff --git a/lib/treppe/treppe.h b/lib/treppe/treppe.h index ea3d0c6..9c52a18 100644 --- a/lib/treppe/treppe.h +++ b/lib/treppe/treppe.h @@ -17,8 +17,8 @@ class Treppe { private: const uint8_t stufen; uint16_t time_per_stair = 300; // dimmtime per stair [ms] - uint16_t idle_brightness = 0; - uint16_t active_brightness = 500; + uint16_t idle_brightness = 100; + uint16_t active_brightness = 700; uint16_t ldr_schwelle = 7; // activation value for FSM [lx] @@ -32,17 +32,11 @@ private: uint16_t ticks_pro_stufe = 0; float differenz_pwm_pro_tick = 0.0; - bool dimm_stufe(uint8_t stufe); - void anim_tick(); - void start_animation(); - void berechne_dimmer(); - // initialize with i2c-Address 0, use Wire Library PCA9685 pwmController; FSMTreppeModelClass FSMTreppe_Obj; FSMTreppeModelClass::ExtU_FSMTreppe_T fsm_inputs; FSMTreppeModelClass::ExtY_FSMTreppe_T fsm_outputs; - void print_state_on_change(); enum fsm_status_t { ST_INAKTIV_LDR =0, ST_RUHEZUSTAND =1, @@ -62,6 +56,14 @@ private: DR_AUFDIMMEN=1 }; + /* DIMM */ + bool dimm_stufe(uint8_t stufe); + void anim_tick(); + void start_animation(); + void berechne_dimmer(); + void print_state_on_change(); + + /* LDR */ bool read_sensor(int sensor); float read_ldr(); bool check_ldr(); diff --git a/templ_platformio_ini b/templ_platformio_ini index 6ce861a..3d4b22b 100644 --- a/templ_platformio_ini +++ b/templ_platformio_ini @@ -16,7 +16,8 @@ data_dir = data_gz [env:hardware] platform = espressif8266 -board = nodemcuv2 +; board = nodemcuv2 +board = huzzah framework = arduino ; for pio check @@ -31,7 +32,7 @@ check_skip_packages = yes board_build.filesystem = littlefs board_build.ldscript = eagle.flash.4m1m.ld extra_scripts = pre:create_gz_files.py -monitor_speed = 115200 +monitor_speed = 76800 [env:serial] extends = env:hardware