Actually, i just realized: when it hits the violation, the motors were running, and the print statements were activated. What i mean is that we have a function , PrintData():
Code:
PrintData(){
printf("\r------------------------- USER INPUTS -------------------------------\r");
printf("Joystick 1 Y-axis: %d\t Joystick 1 Trigger: %d\r", left_joy, p1_sw_trig);
printf("Joystick 2 Y-axis: %d\t Joystick 2 Trigger: %d\r", right_joy, p2_sw_trig);
printf("\r------------------------- PWM OUTPUTS -------------------------------\r");
printf("Left Motor: %d\t Right Motor: %d\r", (int)left_motor, (int)right_motor);
printf("Relay 1 Forward: %d\t Relay 1 Reverse: %d\r", relay1_fwd, relay1_rev);
printf("Relay 2 Forward: %d\t Relay 2 Reverse: %d\r", relay2_fwd, relay2_rev);
/* printf("\r------------------------- SENSORS -------------------------------\r");
*/
printf("\r------------------------- VARIABLES -------------------------------\r");
printf("Alt Left Encoder: %dl\t Alt Right Encoder: %dl\r", Encoder_1_Counter, Encoder_2_Counter);
}
i think maybe the encoders fired during the print statement, which would explain the hyphens. Do you think that could cause problems