//set joystick axis, private class to be called
private bool convertAndSetJoystickAxis()
{
//no motion in joystick is X = 16383, Y = 16383
// y = 16384x + 16384, calculation is done in this method
int xScaled = (int)Math.Floor(16384 * xRaw) + 16384;
int yScaled = (int)Math.Floor(16384 * yRaw) + 16384;
//Console.WriteLine("raw value in convert function X: " + xRaw + " Y: " + yRaw);
joystick.SetAxis(xScaled, id, HID_USAGES.HID_USAGE_X);
joystick.SetAxis(yScaled, id, HID_USAGES.HID_USAGE_Y);
// return "Values set as X: " + xScaled + " Y: " + yScaled;
return(true);
}