Пример #1
0
	Input_Out Run(Input_In input)
	{
		//Structs and stuff
		Input_Out output;
		
		X360Controller_In xbIn;
		X360Controller_out xbOut;
		Sensors_In sensIn;
		Sensors_Out sensOut;
		
		sensOut = sensors->Run(sensIn);
		xbOut = controller->Run(xbIn);
		
		//Retreving controller info
		output.returnX = xbOut.returnX;
		output.returnY = xbOut.returnY;
		output.returnRotation = xbOut.returnRotation;
		output.returnTurbo = xbOut.returnTurbo;
		output.returnTriggerPressed = xbOut.returnTriggerPressed;
		output.returnButtonPressed = xbOut.returnButtonPressed;
		
		//Retreving sensor info
		output.returnGyroAngle = sensOut.returnGyroAngle;
		output.returnAccelX = sensOut.returnAccelX;
		output.returnAccelY = sensOut.returnAccelY;
		output.returnAccelZ = sensOut.returnAccelZ;
		output.returnDistance = sensOut.returnDistance;
		
		return output;
	}
Пример #2
0
	Input_Out Run(Input_In input)
	{
		// Declaring all necessary structs
		Input_Out output;

		X360Controller_In xbIn;
		X360Controller_Out xbOut;
		Sensors_In sensIn;
		Sensors_Out sensOut;

		sensIn.resetGyro = xbOut.returnResetGyro;

		// Running to obtain necessary information
		sensOut = sensors->Run(sensIn);
		xbOut = controller->Run(xbIn);

		// Controller info
		output.returnX = xbOut.returnX;
		output.returnY = xbOut.returnY;
		output.returnRotation = xbOut.returnRotation;
		output.returnTurboMode = xbOut.returnTurboMode;
		output.returnLiftAmount = xbOut.returnLiftAmount;
		output.returnLiftTurbo = xbOut.returnLiftTurbo;
		output.returnLiftActive = xbOut.returnLiftActive;
		output.returnLiftManualControl = xbOut.returnLiftManualControl;
		output.returnLiftState = xbOut.returnLiftState;

		//Sensor info
		output.returnGyroAngle = sensOut.returnGyroAngle;
		output.returnAccelX = sensOut.returnAccelX;
		output.returnAccelY = sensOut.returnAccelY;
		output.returnAccelZ = sensOut.returnAccelZ;
		output.returnDistance = sensOut.returnDistance;
		output.returnUpperLiftSwitch = sensOut.returnUpperLiftSwitch;
		output.returnLowerLiftSwitch = sensOut.returnLowerLiftSwitch;

		return output;
	}