HTML icon

1.5.1JacobHoward.c

HTML | PRO | 03/06/19 01:05:00 AM UTC | 0 ⭐ | 417 👁️ | Never ⏰ | []
C |

2.71 KB

|

None

|

0 👍

/

0 👎

#pragma config(Sensor, in1,    lineFollower,   sensorLineFollower)
#pragma config(Sensor, in2,    potentiometer,  sensorPotentiometer)
#pragma config(Sensor, dgtl1,  limitSwitch,    sensorTouch)
#pragma config(Sensor, dgtl2,  bumpSwitch,     sensorTouch)
#pragma config(Sensor, dgtl3,  quad,           sensorQuadEncoder)
#pragma config(Sensor, dgtl5,  sonar,          sensorSONAR_cm)
#pragma config(Sensor, dgtl12, green,          sensorLEDtoVCC)
#pragma config(Motor,  port1,           flashlight,    tmotorVexFlashlight, openLoop, reversed)
#pragma config(Motor,  port2,           rightMotor,    tmotorVex393_MC29, openLoop)
#pragma config(Motor,  port3,           leftMotor,     tmotorVex393_MC29, openLoop)
#pragma config(Motor,  port9,           servoMotor,    tmotorServoStandard, openLoop)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//
 
task main()
{
/*
untilBump(bumpSwitch);
startMotor(rightMotor, 67);
wait(5);
stopMotor(rightMotor);
*/
 
/*
untilBump(bumpSwitch);
startMotor(rightMotor, 50);
startMotor(leftMotor, 50);
wait(1);
untilBump(bumpSwitch);
startMotor(rightMotor, -50);
startMotor(leftMotor, -50);
wait(3.5);
stopMotor(rightMotor);
stopMotor(leftMotor);
*/
 
/*
untilPotentiometerLessThan(2048, potentiometer);
turnLEDOn(green);
untilPotentiometerGreaterThan(2048, potentiometer);
turnLEDOff(green);
startMotor(leftMotor, 50);
untilPotentiometerLessThan(2048, potentiometer);
stopMotor(leftMotor);
*/
 
/*
startMotor(leftMotor, 63);
startMotor(rightMotor, 63);
untilEncoderCounts(480, quad);
startMotor(leftMotor, -63);
startMotor(rightMotor, -63);
untilEncoderCounts(1260, quad);
stopMotor(leftMotor);
stopMotor(rightMotor);
*/
 
/*
setServo(servoMotor, 127);
untilLight(1700, lineFollower);
setServo(servoMotor, -127);
*/
 
/*
untilSonarLessThan(20, sonar);
startMotor(leftMotor, 63);
startMotor(rightMotor, 63);
untilSonarGreaterThan(25, sonar);
stopMotor(leftMotor);
stopMotor(rightMotor);
*/
 
/*
1. In the beginning, we needed to swap out our cortex due to a "bootloader" error it was encountering upon startup. For a little while,
the program kept telling us that the firmware was out of date, but I was able to fix this by manually updating the robot firmware instead
of using the automatic option. Also, we didn't have an ultrasonic sensor, so that last problem was purely guesswork on the code since it couldn't
actually  be debugged.
 
2. Bump and limit switches can both be used to engage or disengage a machine. Potentiometers could /potentially/ be used to measure how many degrees
a robot arm has travelled from home. Encoders could also be used to measure how far a machine has travelled (by use of an auxiliary wheel).
*/
 
}

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎