   return checkOK(100);
 }
 
-uint8_t checkOK(int timeout)
+uint8_t checkOK(uint32_t timeout)
 {
-  static uint32_t time = millis();
+  uint32_t time = millis();
   while (millis() - time < timeout)
   {
     if (Serial.available() >= 3)

// Get the range in cm. Need to enable sensor first then wait briefly for it to power up
// Also request temperture sensor, if previously detected, to take a reading.
// Disable sensor after use.
uint16_t getRange() {
  int16_t pulse;  // number of pulses from sensor
  int i=0;
  // These values are for calculating a mathematical median for a number of samples as

#include <OneWire.h>
#include <DallasTemperature.h>

// Used in START msg to indicate firmware version, 313 = 3.1.3
#define VERSION_ID 313

// Hardware pin defines
// Enable SRF
