We have been having a problem with our limit switches. They have been consistently breaking when we hit the goal post. We have been replacing them with the same result every time. Here is a pic. Also, here is the code that our robot runs on.
while(true) // Sensor setup when not pressed
{sleep(3000);
if(SensorValue[frontSwitch]==0)
{
motor(FrontS)=127; // start of autonomous code
motor(ESystem)=0;
motor(RDrive)=100; // speed test
motor(LDrive)=127; // speed test
motor(Tray)=0;
}
else
{// if switch is pressed
motor(RDrive)=0;
motor(LDrive)=0;
motor(FrontS)=127;
motor(Tray)=100; // Tray speed for testing
motor(ESystem)=127; //end of autonomous code
}
}
}