   {
     degreesEncoder = DEGREE_LIMIT_MAX;
   }
-  
+
   Serial.println(degreesEncoder);
   attachInterrupt(ENCODER_PIN_B, encoderRiseB, RISING);
 }

  if (encoderSignalA == LOW)
  {
    degreesEncoder = degreesEncoder + DEGREE_STEP;
  }  
  else if (encoderSignalA == HIGH)
  {
    degreesEncoder = degreesEncoder - DEGREE_STEP;
  }
  
  if (degreesEncoder > DEGREE_LIMIT_MAX) 
  {
    degreesEncoder = DEGREE_LIMIT_MIN;
  }

 * It's desired to fire the different tasks with specific intervals.
 * Ex. Fire GPS task with 2000ms intervals and so on...
 */
#define GPS_TASK_INTERVAL   2000
#define SERVO_TASK_INTERVAL 50
#define TFT_TASK_INTERVAL   1000

// Servo positions (approx analog values)
#define MAX_POSITION    4040 // Maximum position
#define CENTER_POSITION 2020 // Center position
#define MIN_POSITION    0    // Minimum position

// Different A/D resolutions
#define RESOLUTION_READ  12 // Number of bits we want to use as resolution reading analog input
#define RESOLUTION_WRITE 12 // Number of bits we want to use as resolution writing analog output

// Different pins
#define JOYSTICK_PIN       A0
#define SERVO_PIN          DAC0
#define SERVO_FEEDBACK_PIN A1
#define MODE_SWITCH_PIN    2
#define TFT_CS             10
#define TFT_RESET          9
#define SD_CS              4
#define SHOW_SPLASH_PIN    5
#define USE_GPS_PIN        8
#define ENCODER_PIN_A      11
#define ENCODER_PIN_B      12
#define SET_COURSE_PIN     3

// Navigation defines
#define DEGREE_LIMIT_MAX 360
#define DEGREE_LIMIT_MIN 1
#define DEGREE_STEP      0.5

// Different baud rates and serial stuff
#define BAUD_RATE     115200  // Desired baud rate for serial debug communication
#define GPS_BAUD_RATE 9600    // Seems to be the standard for Adafruits MTK GPS's, could use 4800 also
#define GPS_SERIAL    Serial1 // DUE has 3 hardware USART so we can use one hardware serial for the GPS

// Colors in RGB565 format
#define ARDUINO_BLUE 0x04B3
#define IRIS_GRAY    0xC618

// Text stuff
#define NORMAL_LINE_SPACE 16
