   float degC = 0.;
   for (int i = 0; i < n; i++) {
     // (analogRead * 3300.0/1024.0 - 500.0)/10.0
-    degC += analogRead(pin) * 0.322265625 - 50.0;
+    degC += analogRead(pin) * 0.322265625 - 50.0;    // use for 3.3v AREF
+    //degC += analogRead(pin) * 0.170898438 - 50.0;  // use for 1.75v AREF
   }
   // return average from n reads
-  return degC / n;
+  return degC / float(n);
 }
 
 void parseCommand(void) {

const bool DEBUG = false;

// constants
const String vers = "1.4.3";   // version of this firmware
const long baud = 115200;      // serial baud rate
const char sp = ' ';           // command separator
const char nl = '\n';          // command terminator

      1.4.3 required Arduino IDE Version >= 1.0.0
      1.5.0 remove webusb
      1.6.0 average 10 temperature measurements to reduce noise
      2.0.0 added binary communications.
            T1B and T2B commands return 32-bit float
            Q1B and Q2B commands return 32-bit float confirmation of heater setting
            added calculation to use 1.75 AREF to match TMP36 voltage range 
*/

#include "Arduino.h"
