RoboCatz.com

Program 8 (Fall 2022)


The code below is a set of functions, variables, constants, and algorithms that are the work of RoboCatz for the Fall 2022 season.

function moveForward(inches,powerLevel=67){
	resetEncoder(B)
	syncMotors(B,C,powerLevel)
	waitHereWhile abs(encoderValue(B))<50*inches
	stopAllMotors(true)
}
function moveBackward(inches){
	resetEncoder(B)
	syncMotors(B,C,-80)
	beep()
	//sleep(1000)
	waitHereWhile abs(encoderValue(B))<48*inches
	stopAllMotors()
}
function turnright(){
	resetGyroSensor()
	syncMotors(B,C,100,200)
	waitHereWhile abs(gyroSensorValue())<90
	stopAllMotors()
}
function liftWall(power){
	setMotor(D,power)
	sleep (2000)
}
function resetWall(power){
	setMotor(D,power)
	sleep(1000)
	waitHereUntil getMotorSpeed(D)==0
}

//dino
moveForward(77)