1900X/Catapult with Drum Test.c
void moveCatapultDrumDist (int count, int direction) {
	int target;
	if (direction == DOWN) {
		setRatchetPos(DOWN);
		target = SensorValue[drumPosEnc] + count;
		writeDebugStreamLine("down target: %d",target);
		while(SensorValue[drumPosEnc] < target) {
			setDrumMotors(127);
			wait1Msec(25);
		}
	} else { //direction == UP
		//move the catapult down a little to release the ratchet
		setRatchetPos(UP);
		//move drum as requested
		target = SensorValue[drumPosEnc] - count;
		writeDebugStreamLine("up target %d",target);
		while(SensorValue[drumPosEnc] < target) {
			setDrumMotors(-127);
			wait1Msec(25);
		}
	}
	setDrumMotors(0);
}
//full rev = 360*7
//automatically releases ratchet first
full rev = 360*7
automatically releases ratchet first
full rev = 360 * 7 automatically releases ratchet first
void moveCatapultDrumDist (int count, int direction) {
	int target;
	if (direction == DOWN) {
		setRatchetPos(DOWN);
		target = SensorValue[drumPosEnc] + count;
		writeDebugStreamLine("down target: %d",target);
		while(SensorValue[drumPosEnc] < target) {
			setDrumMotors(127);
			wait1Msec(25);
		}
	} else { 
		setRatchetPos(UP);
		target = SensorValue[drumPosEnc] - count;
		writeDebugStreamLine("up target %d",target);
		while(SensorValue[drumPosEnc] < target) {
			setDrumMotors(-127);
			wait1Msec(25);
		}
	}
	setDrumMotors(0);
}
void moveCatapultDrumDist ( int count , int direction ) { int target ; if ( direction == DOWN ) { setRatchetPos ( DOWN ) ; target = SensorValue [ drumPosEnc ] + count ; writeDebugStreamLine ( " " , target ) ; while ( SensorValue [ drumPosEnc ] < target ) { setDrumMotors ( 127 ) ; wait1Msec ( 25 ) ; } } else { setRatchetPos ( UP ) ; target = SensorValue [ drumPosEnc ] - count ; writeDebugStreamLine ( " " , target ) ; while ( SensorValue [ drumPosEnc ] < target ) { setDrumMotors ( -127 ) ; wait1Msec ( 25 ) ; } } setDrumMotors ( 0 ) ; }
full rev = 360*7
automatically releases ratchet first
full rev = 360 * 7 automatically releases ratchet first
//direction == UP //move the catapult down a little to release the ratchet //move drum as requested