Skip to content

Commit

Permalink
fix time reboot bug
Browse files Browse the repository at this point in the history
  • Loading branch information
loan-mgt committed May 26, 2023
1 parent 56a6008 commit 4cc5e0b
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions lowsun/lowsun.ino
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ void manageSettingsDoor() {
if( motor1.get_position() == last_motor_position){
same_for++;
}
last_motor_position = motor1.get_position(;
last_motor_position = motor1.get_position();

}

Expand All @@ -229,11 +229,7 @@ void manageSettingsDoor() {


} else {
noInterrupts();
Serial.println("else continue Door");
Serial.println(current_target);
Serial.println(motor1.target_reached());
interrupts();



motor1.set_target(current_target);
Expand Down Expand Up @@ -392,14 +388,24 @@ void manageLight() {

void manageDate() {
if (dateCharacteristic.written()) {


long xx = getLongFromBytes(dateCharacteristic.value());

rtc.setTime(xx);
noInterrupts();
Serial.println("Date update");
Serial.println(xx);
Serial.println(rtc.getEpoch());


Serial.print(dateCharacteristic.value()[0]);
Serial.print(";");
Serial.print(dateCharacteristic.value()[1]);
Serial.print(";");
Serial.print(dateCharacteristic.value()[2]);
Serial.print(";");
Serial.println(dateCharacteristic.value()[3]);
//Serial.println(rtc.getEpoch());
interrupts();

} else {
Expand Down

0 comments on commit 4cc5e0b

Please sign in to comment.