   delay(1000);
   SCOREBD.println(F("D1"));
   delay(1000);
-  SCOREBD.println(F("D0"));
+  SCOREBD.println(F("Z"));
   delay(100);
   //start listening to the targets
   TARGET.println(F("S"));
+  TARGET.println(F("D"));
   //start the timer
   TIMER.println(F("S"));
   start_time = millis();
-  last_update = millis() - (2 * RESEND_TIMER);
-}
-  
+  last_update = millis() + RESEND_TIMER;
+}  

      float val = (exp(sin(millis()/1000.0*PI)) - 0.36787944)*108.0;
      analogWrite(LED, val);
    } 
    if (digitalRead(BUTTON) == HIGH) {
      state = START_THE_GAME;
    }
  } 
  
  else if (state == START_THE_GAME) {
    //set the initial conditions for play
    start();
    state = RUNNING;
  } 

#include <Wire.h>
#include <SL018.h>

#define DEBUG 0

#define BAUD 9600
#define RESEND_TIMER 50
#define RUN_TIMER 30250
#define UPDATE_DELAY 10
#define RFID_DIGITS 15
#define BUTTON 2
#define RESET 3
#define LED 13
#define RFID 4
#define TARGET Serial1
#define SCOREBD Serial2
#define TIMER Serial3

//states
#define RFID_READY 1
#define WAIT_FOR_START 2
#define START_THE_GAME 3
#define RUNNING 4
#define CLEAN_UP 5

SL018 rfid;

char player_rfid[RFID_DIGITS];
unsigned long score = 0UL;
int state = RFID_READY;
unsigned long start_time = 0UL;
unsigned long last_update = 0UL;
