|
|
@@ -303,6 +303,8 @@ void Treppe::setup() |
|
|
|
pwmController.setPWMFrequency(100); |
|
|
|
//pwmController.setAllChannelsPWM(idle_pwm); |
|
|
|
|
|
|
|
EEPROM.get(EEP_START_ADDR, parameters); // get Parameters of flash |
|
|
|
|
|
|
|
pinMode(13, OUTPUT); |
|
|
|
pinMode(0, OUTPUT); |
|
|
|
digitalWrite(13, HIGH); |
|
|
@@ -317,13 +319,17 @@ void Treppe::setup() |
|
|
|
Serial.printf("Treppe: stufen=%d\n", stufen); |
|
|
|
} |
|
|
|
|
|
|
|
void Treppe::saveParam(){ |
|
|
|
EEPROM.put(EEP_START_ADDR, parameters); // copy Parameters so "EEPROM"-section in RAM |
|
|
|
EEPROM.commit(); // write "EEPROM"-section to flash |
|
|
|
} |
|
|
|
|
|
|
|
void Treppe::set_idle_prozent(const int prozent) |
|
|
|
{ |
|
|
|
// future use: parameters.idle_max_pwm |
|
|
|
uint16_t new_pwm = parameters.active_pwm * prozent / 100; |
|
|
|
set_idle_pwm_max(new_pwm); |
|
|
|
} |
|
|
|
|
|
|
|
void Treppe::set_idle_pwm_max(const uint16_t new_pwm) |
|
|
|
{ |
|
|
|
// future use: parameters.idle_max_pwm |
|
|
@@ -335,15 +341,18 @@ void Treppe::set_idle_pwm_max(const uint16_t new_pwm) |
|
|
|
|
|
|
|
Serial.printf("Treppe: idle_pwm_soll=%d\n", idle_pwm_soll); |
|
|
|
fsm_pend.ldr_changed = true; |
|
|
|
//saveParam(); //uncomment if idle_pwm_max is used |
|
|
|
} |
|
|
|
|
|
|
|
void Treppe::set_active_pwm(uint16_t _active_pwm) |
|
|
|
{ |
|
|
|
parameters.active_pwm = _active_pwm; |
|
|
|
Serial.printf("Treppe: active_pwm=%d\n", parameters.active_pwm); |
|
|
|
saveParam(); |
|
|
|
} |
|
|
|
void Treppe::set_time_per_stair(uint16_t _time_per_stair) |
|
|
|
{ |
|
|
|
parameters.time_per_stair = _time_per_stair; |
|
|
|
Serial.printf("Treppe: time_per_stair=%d\n", parameters.time_per_stair); |
|
|
|
saveParam(); |
|
|
|
} |