 bool quadModeIndex = 0;
 bool octoModeIndex = 0;
 
+bool inError = false;
+
 MCP_CAN CAN(SPI_CS_PIN); 
 
 void setup() {
+
+  pinMode(2, OUTPUT);
 
   lcd.createChar(0, fill1);
   lcd.createChar(1, fill2);

  unsigned long badCount;
  unsigned long totalCount;
  byte percent;
  
  for(byte i = 0; i < len; i++) {
    badCount = allGauges[i]->lowCount + allGauges[i]->highCount;
    totalCount = badCount + allGauges[i]->goodCount;
    percent = badCount * 100 / totalCount;
    if(percent > 9) {
      Serial.println(allGauges[i]->shortLabel);
      Serial.println(allGauges[i]->lowCount);
      Serial.println(allGauges[i]->highCount);
      Serial.println(allGauges[i]->goodCount);
      return true;
    }
  }
  return false;
}


      //draw_octo_gauges();
      //draw_dual_gauges();
      draw_quad_gauges();
  }

  if(currentMillis - lastDiagnosticMillis >= diagnosticInterval && currentMillis > 500) {
    lastDiagnosticMillis = currentMillis;
    bool err = calculate_error_light();

    if(err != inError) {
      inError = err;
      digitalWrite(2, err);  
    }

    
    
    //Serial.println(err);
  }
}

