void loop() {
  if ( Spark.connected() == true){
    //let the web know we are alive!
    Spark.publish("ticker-connected");
    //Make sure the function is registered
    Spark.function("celebrate", setSalvations);
    Spark.function("reset", clearSalvations);

    //Incase the no wifi pixel is showing
    matrix.setPixelColor(57,0,0,0);
    matrix.show();
  }else{
    if ( WiFi.connecting() == false){
      //Light UP missing wifi LED
      missingWifi();
    }
  }

  //Read low battery pin
  if(digitalRead(batteryPin) == LOW){
    lowBattery();
  }else{
    matrix.setPixelColor(56,0,0,0);
    matrix.show();
  }

  //Wait 5 minutes before checking again.
  // delay(300000);
}
//Show BLUE LED if low battery.
void lowBattery(){
  matrix.setPixelColor(56,100,0,0);
  matrix.show();
}
//Show YELLOW LED if no WIFI.
void missingWifi(){
  matrix.setPixelColor(57,0,0,255);
  matrix.show();
}