 	state = IDLE;
       }      
     }     
-
 	
     if (pressed == true) {      
       changes = (softpotReading - softpotInitV) / delta_threshold;      

    g = sliderEvent(&changes, 0);
    if (g!= 0)
      DEBUG_PRINTLN(g);
    return;
  }
  
  switch(state) {
  case IDLE:
    delay(20);
    if (false) { // g == gPRESSED) {
      DEBUG_PRINTLN("[INIT] Entering");      
      // state = INIT;
      g = gNONE;
    }
    selectedXBee = -1;
    break;
  case INIT:
    DEBUG_PRINTLN("[INIT] Sending IR");
    session_id = random(0xFFFF);
    // irsend.sendSony(session_id, 16);
    XBee.print(session_id, HEX);  

    // at the same time listening to any response
    state = WAIT;

{
  Serial.begin(9600);
  state = IDLE;
  Serial.println('System Begins!');
  digitalWrite(softpotPin, HIGH); //enable pullup resistor
  randomSeed(analogRead(5));
  digitalWrite(ledPin, LOW);
