Hi,
during my test I found one more problem. Currently with Timer :
When Timer is on and I have two defined times :
1 window - Monday - Friday 5:00 - 6:30
2 window - Monday - Friday 14:00 - 16:00
Problem is, that mower will start the operation and after minute will stop the operation and track into charging station. When it is in the station, after one minute will start operation again. I think it's problem in checkTimer :
Can you please say that it's a bug?
Alex
during my test I found one more problem. Currently with Timer :
When Timer is on and I have two defined times :
1 window - Monday - Friday 5:00 - 6:30
2 window - Monday - Friday 14:00 - 16:00
Problem is, that mower will start the operation and after minute will stop the operation and track into charging station. When it is in the station, after one minute will start operation again. I think it's problem in checkTimer :
Code:
// check timer
void Robot::checkTimer(){
if (millis() < nextTimeTimer) return;
nextTimeTimer = millis() + 60000;
srand(time2minutes(datetime.time)); // initializes the pseudo-random number generator for c++ rand()
randomSeed(time2minutes(datetime.time)); // initializes the pseudo-random number generator for arduino random()
receiveGPSTime();
boolean stopTimerTriggered = true;
if (timerUse){
for (int i=0; i < MAX_TIMERS; i++){
if (timer[i].active){
if ( (timer[i].daysOfWeek & (1 << datetime.date.dayOfWeek)) != 0) {
int startmin = time2minutes(timer[i].startTime);
int stopmin = time2minutes(timer[i].stopTime);
int currmin = time2minutes(datetime.time);
if ((currmin >= startmin) && (currmin < stopmin)){
// start timer triggered
stopTimerTriggered = false;
if ((stateCurr == STATE_STATION) || (stateCurr == STATE_OFF)){
Console.println(F("timer start triggered"));
motorMowEnable = true;
setNextState(STATE_FORWARD, 0);
}
}
}
if ((stopTimerTriggered) && (timer[i].active)){
if (stateCurr == STATE_FORWARD){
Console.println(F("timer stop triggered"));
if (perimeterUse){
setNextState(STATE_PERI_FIND, 0);
}
else setNextState(STATE_OFF,0);
}
}
}
}
}
}
Can you please say that it's a bug?
Alex