Added Serial.println to see what's up with ir, motor