user63723: as the question title states, how will I go about turning the servo opposite of 90 degrees?
I have written my code as such;
  // Turn servo to the right
  if(x > 520 && y < 510 && y > 490){
  servo.write(0);
  delay(50);

  //Turn left
  }else if(x < 490 && y < 510 && y > 490){
    servo.write(180);
    delay(50);

 //Turn backwards
} else if(y < 490 && x < 520 && x > 490){
  servo.write(-90);
  delay(50);

Obviously -90 isn't an actual degree on the servo, and it will only turn between 0 and 180. I was therefore wondering if there was any other way to code it?
The servo is connected to a joystick, and the plan is to built a 360 degrees vertical and 180 degrees horizontal turret of sorts. Every other command works, and when I replace -90 with 90 degrees, it works as well. So it is wired correctly.
Of course I would have to add another joystick and another servo later on, but at this stage I am simply testing my own coding skills.

user4143: Normal servos only have a range of 180°. You can give yourself an "offset", so you have -90° to 90°, but you only ever get 180° range. You can't go -90° to 180°.
Using mechanics (outside the scope of this site) you can multiply your movement (think gears) so that your range is bigger.

user2967: You say "The servo is connected to a joystick, and the plan is to built a 360 degrees vertical and 180 degrees horizontal turret of sorts. "
That doesn't make sense. How could a joystick rotate 360° in one dimension and 180° in the other dimension? 
A joystick does not need an angle greater than 180°. It's mounted to a flat surface, and can only move 180° in two different dimensions, X and Y. (And actually probably more like 120° in each dimension.)
Use two 180 degree servos, one for the X axis and one for the Y axis.
Set the "neutral" position to 0
You can map the range 0 - 1320  to -90 to 90 using a map statement. (or adjust as needed since the range of motion of the joystick is probably less than 180 degrees - more like 120°, like  chrisl said in their comment.)
See this article for info on how a 2-axis joystick works. Specifically look at the section titled "Gimbal Mechanism" a little ways down in the article.

user313: If I understand correctly, you only need to move your servo through 180 degrees total, from one limit to the other, but you want -90 to represent one of the limits and +90 to represent the opposite limit? If so, just add 90 to the servo angle before you send it:
servo.write(angle+90);

This turns -90 into 0, 0 into 90, and 90 into 180. You get to use the coordinates that you like (-90 - +90) and the servo sees the coordinates it needs (0 - 180).
This is a simple case of mapping; there is a map() function that can do this for you for all mapping all kinds of ranges, one into another. Mapping (-90 - 90) into (0 - 180) is so straightforward that the map function really doesn't add anything, but in other cases it's handy to know about.

63723: <p>as the question title states, how will I go about turning the servo opposite of 90 degrees?</p>

<p>I have written my code as such;</p>

<pre><code>  // Turn servo to the right
  if(x &gt; 520 &amp;&amp; y &lt; 510 &amp;&amp; y &gt; 490){
  servo.write(0);
  delay(50);

  //Turn left
  }else if(x &lt; 490 &amp;&amp; y &lt; 510 &amp;&amp; y &gt; 490){
    servo.write(180);
    delay(50);

 //Turn backwards
} else if(y &lt; 490 &amp;&amp; x &lt; 520 &amp;&amp; x &gt; 490){
  servo.write(-90);
  delay(50);
</code></pre>

<p>Obviously -90 isn't an actual degree on the servo, and it will only turn between 0 and 180. I was therefore wondering if there was any other way to code it?</p>

<p>The servo is connected to a joystick, and the plan is to built a 360 degrees vertical and 180 degrees horizontal turret of sorts. Every other command works, and when I replace -90 with 90 degrees, it works as well. So it is wired correctly.</p>

<p>Of course I would have to add another joystick and another servo later on, but at this stage I am simply testing my own coding skills.</p>
 4143: <p>Normal servos only have a range of 180°. You can give yourself an "offset", so you have -90° to 90°, but you only ever get 180° range. You can't go -90° to 180°.</p>

<p>Using mechanics (outside the scope of this site) you can multiply your movement (think gears) so that your range is bigger.</p>
 2967: <p>You say "The servo is connected to a joystick, and the plan is to built a 360 degrees vertical and 180 degrees horizontal turret of sorts. "</p>

<p>That doesn't make sense. How could a joystick rotate 360° in one dimension and 180° in the other dimension? </p>

<p>A joystick does not need an angle greater than 180°. It's mounted to a flat surface, and can only move 180° in two different dimensions, X and Y. (And actually probably more like 120° in each dimension.)</p>

<p>Use two 180 degree servos, one for the X axis and one for the Y axis.</p>

<p>Set the "neutral" position to 0</p>

<p>You can map the range 0 - 1320  to -90 to 90 using a map statement. (or adjust as needed since the range of motion of the joystick is probably less than 180 degrees - more like 120°, like  chrisl said in their comment.)</p>

<p>See <a href="https://lastminuteengineers.com/joystick-interfacing-arduino-processing/" rel="nofollow noreferrer"><strong>this article</strong></a> for info on how a 2-axis joystick works. Specifically look at the section titled "Gimbal Mechanism" a little ways down in the article.</p>
 313: <p>If I understand correctly, you only need to move your servo through 180 degrees total, from one limit to the other, but you want -90 to represent one of the limits and +90 to represent the opposite limit? If so, just add 90 to the servo angle before you send it:</p>
<pre><code>servo.write(angle+90);
</code></pre>
<p>This turns -90 into 0, 0 into 90, and 90 into 180. You get to use the coordinates that you like (-90 - +90) and the servo sees the coordinates it needs (0 - 180).</p>
<p>This is a simple case of mapping; there is a map() function that can do this for you for all mapping all kinds of ranges, one into another. Mapping (-90 - 90) into (0 - 180) is so straightforward that the map function really doesn't add anything, but in other cases it's handy to know about.</p>
