 
 // Lookup the pixel's color for the wheel based interface.
 uint32_t wheelColorLookup(int led, float angle) {
+  // Flip image
+  led = LEDS - led;
+
+  // We had a 34 cm radius for the wheel. The image strip was 100 cm long. Then
+  // we needed to scale this according to the image aspect ratio. Otherwise this
+  // is just basic sector length formula angle = sectorlength/radius.
   float maxAngle = IMAGE_WIDTH / float(IMAGE_HEIGHT) * 100 / 34;
-  int x = int(mapfloat(angle, -PI, maxAngle, 0.0, float(IMAGE_WIDTH-1)));
-
-  if (x >= IMAGE_WIDTH) {
+
+  // The angles needed a bit of calibration related to the wheel orientation.
+  int x = int(mapfloat(angle, -PI+PI/2, maxAngle-PI+PI/2, 0.0, float(IMAGE_WIDTH-1)));
+
+  if (x >= IMAGE_WIDTH || x < 0) {
     return lookupColor(-1, 1.0);
   }
 

}

// Returns the color from the palette. Return black if pixelindex is -1.
uint32_t lookupColor(int pixelIndex, float brightnessFactor) {
  if (pixelIndex < 0 || pixelIndex >= IMAGE_SIZE) {
    rgb = {0, 0, 0};

  /* Accelerometer code */
  /**********************/

  // The ifndef is needed because pulseIn expects PWM signal, without the
  // accelerometer connected the loop function got called very slowly.
  #ifndef TIMER
  int pulseX = pulseIn(ACCEL_X_PIN, HIGH);
  int pulseY = pulseIn(ACCEL_Y_PIN, HIGH);
