 
 //Return codes: 0=response ok, 1=waiting for a response, 2=heartbeat sent, 3=incorrect response, 4=lost communications
 //42=lost communications, sent a new one, 41=lost comms, waiting for a response to new heartbeat, 43=lost communications, incorrect response
-//The sensor only returns 2
+//The sensor only returns 2 and 3
 int heartbeat(bool sent) {
   static unsigned long timeSent = millis();
   static unsigned int checkValue = 0;

    int checkReturned = atoi((const char *) &num) * 10;
    num = Serial.read();
    checkReturned += atoi((const char *) &num);

    if (opMode == alarm) {


  if (!signalSent && opMode == alarm && millis() - timeSent >= heartbeatTimeout) {
    checkValue = random(0, 53);
    timeSent = millis();
    Serial.print("|" + String(200 + checkValue) + "|");
    signalSent = true;
    if (lostComms) {
      return 42;
