 #if NUM_SLAVES > 1
   1,
 #endif
-#if NUM_SLAVES > 1
+#if NUM_SLAVES > 2
   2,
 #endif
-#if NUM_SLAVES > 1
+#if NUM_SLAVES > 3
   3,
 #endif
-#if NUM_SLAVES > 1
+#if NUM_SLAVES > 4
   4,
 #endif
-#if NUM_SLAVES > 1
+#if NUM_SLAVES > 5
   5
 #endif
 };

{
  Serial.begin(9600);

  pinMode(PIN_STATUS_LED, OUTPUT);
  digitalWrite(PIN_STATUS_LED, HIGH);

  pinMode(PIN_DEBUG_LED, OUTPUT);
  digitalWrite(PIN_DEBUG_LED, HIGH);

  rs485.setup();
  send_buffer = rs485.initBuffer(databuffer);
}


boolean debug_led = false;

int cycle = 0;

#define MODE   3
#define PERIOD 1000

void loop()
{
  long start = millis();
  int slave;

  update_state();



RS485Socket rs485(2, 3, 4, (DEBUG_LEVEL != 0));

#define PIN_LIGHT_SENSE A0

#define PIN_OUTPUT1     9
#define PIN_RCVD_LED   10
#define PIN_XMIT_LED   11
#define PIN_POWER_LED  12
#define PIN_DEBUG_LED  13

#define NUM_SLAVES 1
