I am very new at programming in C++ but I have part of a class that checks to make sure there is a fault that lasts for 60 seconds. The code below is written several times throughout the class for different subsystems dealing with overcurrent.
The timing statement is okay because it works on all of the other fault checkers. It is the if statement that is causing the error I just do not know why.
Code:
// Over Current
if (UUV->getCTaps(MOTORCURRPOS_1) > 1.4*UUV->getcurrMode.getMotor().Peak) // The fault
{
if (motor1Timer == NULL)
motor1Timer = time(&timer);
else if ( time(&timer) - motor1Timer >= 60)
motor1Over = true;
}
else
motor1Timer = NULL;
The timing statement is okay because it works on all of the other fault checkers. It is the if statement that is causing the error I just do not know why.
Comment