#pragma config(Motor,  motor1,          LEG_LEFT,      tmotorVexIQ, PIDControl, encoder)
#pragma config(Motor,  motor7,          LEG_RIGHT,     tmotorVexIQ, PIDControl, reversed, encoder)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//


task TaskMotorLeft()
{
	while( true )
	{
		if( vexRT[ BtnEDown ] )
		{
			setMotorTarget( LEG_LEFT, getMotorEncoder( LEG_LEFT )+360, 50 );
			waitUntilMotorStop( LEG_LEFT );
		}

		if( vexRT[ BtnEUp ] )
		{
			setMotorTarget( LEG_LEFT, getMotorEncoder( LEG_LEFT )+360, 100 );
			waitUntilMotorStop( LEG_LEFT );
		}

		sleep( 20 );
	}
}


task TaskMotorRight()
{
	while( true )
	{
		if( vexRT[ BtnFDown ] )
		{
			setMotorTarget( LEG_RIGHT, getMotorEncoder( LEG_RIGHT )+360, 50 );
			waitUntilMotorStop( LEG_RIGHT );
		}

		if( vexRT[ BtnFUp ] )
		{
			setMotorTarget( LEG_RIGHT, getMotorEncoder( LEG_RIGHT )+360, 100 );
			waitUntilMotorStop( LEG_RIGHT );
		}

		sleep( 20 );
	}
}


task main()
{
	resetMotorEncoder( LEG_LEFT );
	resetMotorEncoder( LEG_RIGHT );

	startTask(TaskMotorLeft);
	startTask(TaskMotorRight);

	repeat( forever )
	{
		sleep( 100 );
	}
}
