HP - Touch
HP - Touch
HP - Touch
Reference
Note: On both the Bumper Switch and the Limit Switch, the red wire is not used. Even if you notice that
the red wire is “falling out” of the sensor, it should not have any effect on the sensor’s performance.
© Carnegie Mellon Robotics Academy / For use with VEX robotics systems Touch Sensors • 1
ROBOTC
Reference
task main ()
{
robotType(recbot); //Specifies the robot type
task main ()
{
robotType(recbot); //Specifies the robot type
Bump to Spin
This code has the robot wait until the touch sensor is bumped and then spin right for 1.5 seconds.
task main ()
{
robotType(recbot); //Specifies the robot type
while(true)
{
stop(); // Stop. Do not move.
untilBump(dgtl6); // Wait for touch sensor in digital
//port 6 to be bumped.
pointTurn(right, 95); // Make a right turn in place at
//speed 95.
wait(1.5); // Wait for 1.5 seconds.
}
}
© Carnegie Mellon Robotics Academy / For use with VEX robotics systems Touch Sensors • 2