changed structure of treppe.h and renamed treppe.cpp accordingly, added header guards
This commit is contained in:
parent
13af5fd197
commit
b4513dc418
@ -194,7 +194,7 @@ float Treppe::read_ldr()
|
|||||||
|
|
||||||
bool Treppe::check_ldr()
|
bool Treppe::check_ldr()
|
||||||
{
|
{
|
||||||
static uint8_t active = 0;
|
static bool active = 0;
|
||||||
|
|
||||||
#ifdef LDRDEBUG
|
#ifdef LDRDEBUG
|
||||||
Serial.printf("R(LDR) = %f kOhm %f lux\n", ldr_value, lux);
|
Serial.printf("R(LDR) = %f kOhm %f lux\n", ldr_value, lux);
|
||||||
@ -203,7 +203,6 @@ bool Treppe::check_ldr()
|
|||||||
|
|
||||||
// follow up: averaging over many samples?
|
// follow up: averaging over many samples?
|
||||||
float ldr = read_ldr();
|
float ldr = read_ldr();
|
||||||
bool active = false;
|
|
||||||
|
|
||||||
if (ldr < ldr_schwelle) {
|
if (ldr < ldr_schwelle) {
|
||||||
idle_pwm_soll = idle_pwm_max;
|
idle_pwm_soll = idle_pwm_max;
|
||||||
@ -229,36 +228,31 @@ void Treppe::task()
|
|||||||
m=micros();
|
m=micros();
|
||||||
fsm_inputs.sensor_oben = read_sensor(SENSOR_OBEN);
|
fsm_inputs.sensor_oben = read_sensor(SENSOR_OBEN);
|
||||||
fsm_inputs.sensor_unten = read_sensor(SENSOR_UNTEN);
|
fsm_inputs.sensor_unten = read_sensor(SENSOR_UNTEN);
|
||||||
//fsm_inputs.anim_beendet = anim_beendet;
|
fsm_inputs.anim_beendet = anim_beendet;
|
||||||
Serial.print("2:");
|
// Serial.print("2:");
|
||||||
Serial.println(micros()-m);
|
// Serial.println(micros()-m);
|
||||||
|
|
||||||
m=micros();
|
m=micros();
|
||||||
// FSMTreppe_Obj.setExternalInputs(&fsm_inputs);
|
FSMTreppe_Obj.setExternalInputs(&fsm_inputs);
|
||||||
Serial.print("3:");
|
// Serial.print("3:");
|
||||||
Serial.println(micros()-m);
|
// Serial.println(micros()-m);
|
||||||
|
|
||||||
m=micros();
|
m=micros();
|
||||||
FSMTreppe_Obj.step();
|
FSMTreppe_Obj.step();
|
||||||
Serial.print("4:");
|
// Serial.print("4:");
|
||||||
Serial.println(micros()-m);
|
// Serial.println(micros()-m);
|
||||||
|
|
||||||
m=micros();
|
m=micros();
|
||||||
fsm_outputs = FSMTreppe_Obj.getExternalOutputs();
|
fsm_outputs = FSMTreppe_Obj.getExternalOutputs();
|
||||||
Serial.print("5:");
|
// Serial.print("5:");
|
||||||
Serial.println(micros()-m);
|
// Serial.println(micros()-m);
|
||||||
|
|
||||||
dimm_treppe();
|
|
||||||
|
|
||||||
m=micros();
|
m=micros();
|
||||||
print_state_on_change();
|
print_state_on_change();
|
||||||
Serial.print("6:");
|
// Serial.print("6:");
|
||||||
Serial.println(micros()-m);
|
// Serial.println(micros()-m);
|
||||||
|
|
||||||
m=micros();
|
m=micros();
|
||||||
|
|
||||||
dimm_treppe();
|
|
||||||
|
|
||||||
if (fsm_outputs.status == ST_AUFDIMMEN_HOCH ||
|
if (fsm_outputs.status == ST_AUFDIMMEN_HOCH ||
|
||||||
fsm_outputs.status == ST_ABDIMMEN_HOCH ||
|
fsm_outputs.status == ST_ABDIMMEN_HOCH ||
|
||||||
fsm_outputs.status == ST_AUFDIMMEN_RUNTER ||
|
fsm_outputs.status == ST_AUFDIMMEN_RUNTER ||
|
||||||
@ -278,8 +272,8 @@ void Treppe::task()
|
|||||||
// anim_beendet = dimm_treppe();
|
// anim_beendet = dimm_treppe();
|
||||||
// }
|
// }
|
||||||
|
|
||||||
Serial.print("7:");
|
// Serial.print("7:");
|
||||||
Serial.println(micros()-m);
|
// Serial.println(micros()-m);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Treppe::berechne_dimmer()
|
void Treppe::berechne_dimmer()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user