 
 // Initialise global position object
 Position globalPos;
+
+/*
+ * Temperature class, keeps information about current temperature (currently just a
+ * value, not based from real temperatures yet) and whether the fan should turn on
+ * or off. Also includes a function which converts current temperature into an 8-bit
+ * value which can be used in the analogWrite() function, when the fan activates.
+ */
+class Temperature {
+ public:
+  int celcius;
+  bool operation; // If the fan should be turned on
+
+  int getFanSpeed() {
+    return map(celcius, 0, MAX_TEMP, 0, 255);
+  }
+
+  Temperature() {
+    celcius = 0;
+    operation = false;
+  }
+};
+
+Temperature temperature;
 
 /*
  * Message class, provides functions to print out standard messages which, in theory,

#define FAN_PIN            9

#define BUZZ_PIN           31

#define PS_ON_PIN          12
#define KILL_PIN           -1

  getSerialInput();
  sX.updateLoop();
  sY.updateLoop();
  fanOn(temperature.operation);
  updatePos();
}
