 
     double tempC = (500.0 * analogRead(tempPin)) / 1204; //poll analog to read value from LM35
     double aveTempC = smoothTemp(tempC);
-    double tempF = c2f(aveTempC);
-
-    splitNumber(tempF);
+    double aveTempF = c2f(aveTempC);
+    
+    if (displayCelcius)
+      splitNumber(aveTempC);
+    else
+      splitNumber(aveTempF);
   }
 }
 

const int dataPin = 8;
const int latchPin = 9;
const int clockPin = 10;

/* General LED layout of seven-segment display
  ___

  //testCaseAllNum();
  //splitNumber(-99.99999);
  displayTemperature();
}

void clearLEDs() {
