Code: #define yDirection (joystick.joy1_y1) #define xDirection (joystick.joy1_x1) float angle = 0.0 short x = xDirection, y = yDirection;
short vectorAngle = angle;
void getJoystickVector() { x = xDirection; y = yDirection; angle = x == 0 && y > 0 ? PI/2 :( x == 0 && y < 0 ? 3*PI/2 :( x >= 0 && y == 0 ? 0 :( x > 0 && y > 0 ? atan(y*1.0/x) :( **Error**:Invalid numeric type (float, string) for assignment to byte variable y >= 0 ? atan(y*1.0/x) + PI :( **Error**:Invalid numeric type (float, string) for assignment to byte variable y < 0 && x > 0 ? atan(y*1.0/x) + 2*PI : atan(y*1.0/x) + PI))))); }
