|
|
|
|
|
|
|
|
private: |
|
|
private: |
|
|
const uint8_t stufen; |
|
|
const uint8_t stufen; |
|
|
uint16_t time_per_stair = 300; // dimmtime per stair [ms] |
|
|
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] |
|
|
uint16_t ldr_schwelle = 7; // activation value for FSM [lx] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
uint16_t ticks_pro_stufe = 0; |
|
|
uint16_t ticks_pro_stufe = 0; |
|
|
float differenz_pwm_pro_tick = 0.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 |
|
|
// initialize with i2c-Address 0, use Wire Library |
|
|
PCA9685 pwmController; |
|
|
PCA9685 pwmController; |
|
|
FSMTreppeModelClass FSMTreppe_Obj; |
|
|
FSMTreppeModelClass FSMTreppe_Obj; |
|
|
FSMTreppeModelClass::ExtU_FSMTreppe_T fsm_inputs; |
|
|
FSMTreppeModelClass::ExtU_FSMTreppe_T fsm_inputs; |
|
|
FSMTreppeModelClass::ExtY_FSMTreppe_T fsm_outputs; |
|
|
FSMTreppeModelClass::ExtY_FSMTreppe_T fsm_outputs; |
|
|
void print_state_on_change(); |
|
|
|
|
|
enum fsm_status_t { |
|
|
enum fsm_status_t { |
|
|
ST_INAKTIV_LDR =0, |
|
|
ST_INAKTIV_LDR =0, |
|
|
ST_RUHEZUSTAND =1, |
|
|
ST_RUHEZUSTAND =1, |
|
|
|
|
|
|
|
|
DR_AUFDIMMEN=1 |
|
|
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); |
|
|
bool read_sensor(int sensor); |
|
|
float read_ldr(); |
|
|
float read_ldr(); |
|
|
bool check_ldr(); |
|
|
bool check_ldr(); |