 /*
   TCLab Temperature Control Lab Firmware
-  Jeffrey Kantor, Bill Tubbs, John Hedengren
-  May 2019
+  Jeffrey Kantor, Bill Tubbs, John Hedengren, Shawn Summey
+  June 2020
 
   This firmware provides a high level interface to the Temperature Control Lab. The
   firmware scans the serial port for commands. Commands are case-insensitive. Any

  }
  else if (cmd == "Q1") {
    setHeater1(val);
    sendResponse(String(Q1));
  }
  else if (cmd == "Q2") {
    setHeater2(val);
    sendResponse(String(Q2));
  }
  else if (cmd == "R1") {
    sendResponse(String(Q1));
  }
  else if (cmd == "R2") {
    sendResponse(String(Q2));
  }
  else if (cmd == "SCAN") {
    sendResponse(String(readTemperature(pinT1)));
    sendResponse(String(readTemperature(pinT2)));
    sendResponse(String(Q1));
    sendResponse(String(Q2));
  }
  else if (cmd == "T1") {
    sendResponse(String(readTemperature(pinT1)));
  }
  else if (cmd == "T2") {
    sendResponse(String(readTemperature(pinT2)));
  }
  else if (cmd == "VER") {
    sendResponse("TCLab Firmware " + vers + " " + boardType);

  P2 float  set pwm limit on heater 2, range 0 to 255. Default 100. Returns P2.
  Q1 float  set Heater 1, range 0 to 100. Returns value of Q1.
  Q2 float  set Heater 2, range 0 to 100. Returns value of Q2.
  Q1B float set Heater 1, range 0 to 100. Returns value of Q1 as a 32-bit float.
  Q2B float set Heater 2, range 0 to 100. Returns value of Q2 as a 32-bit float.
  R1        get value of Heater 1, range 0 to 100
  R2        get value of Heater 2, range 0 to 100
  SCAN      get values T1 T2 Q1 Q1 in line delimited values
  T1        get Temperature T1. Returns value of T1 in °C.
  T2        get Temperature T2. Returns value of T2 in °C.
  T1B       get Temperature T1. Returns value of T1 in °C as a 32-bit float.
  T2B       get Temperature T2. Returns value of T2 in °C as a 32-bit float.
  VER       get firmware version string
  X         stop, enter sleep mode. Returns "Stop"

