  * Function Name  : setup
  * Description    : this function runs once at system boot
  *******************************************************************************/
-void setup() {
+void setup()
+{
 
   //publish startup message with firmware version
   Particle.publish(APP_NAME, VERSION, 60, PRIVATE);
 
+#ifdef USE_NCD_RELAYS
+  Serial.begin(115200);
+  relayController.setAddress(0, 0, 0);
+  triggerRelay("turnoffallrelays");
+
+  Particle.function("controlRelay", triggerRelay);
+  Particle.function("relayStatus", relayStatus);
+
+#else
   //declare and init pins
   pinMode(fan, OUTPUT);
   pinMode(heat, OUTPUT);

{
  settingsHaveChanged = true;
  settingsHaveChanged_timer = 0;

}

/*******************************************************************************

 * Description    : converts the String mode into the int mode (to be saved in the eeprom)
 * Return         : String
 *******************************************************************************/
uint8_t convertModeToInt(String mode)
{
  if (mode == MODE_HEAT)
  {
    return 1;
  }
  if (mode == MODE_COOL)
  {
    return 2;
  }

  //in all other cases
  return 0;
}
