 #define RF24_PAYLOAD sizeof(Packet)
 #define RF24_PIPE    0xF0F0F0F000LL | RECEIVER_ID
 
+// -----------------------------------------
 
-// -----------------------------------------
 struct Packet {
     uint8_t command;
     uint8_t id;
     uint8_t state;
 } packet;
+
+RF24 radio(RF24_CE, RF24_CSN);
+
+bool current_state, rx_ack, tx, fail;
+
 // -----------------------------------------
 
 void goToSleep(uint8_t timeout = 0xFF);
 
 // -----------------------------------------
-
-RF24 radio(RF24_CE, RF24_CSN);
-
-bool timeout, rx_ack, tx, fail;
 
 void setup(void) {
   // Serial.begin(9600);

  wdt_disable();
  wdt_reset();
  WDTCSR &= ~_BV(WDIE);
}
  // Init motor pins
  pinMode(MOTOR_1, OUTPUT);
  pinMode(MOTOR_2, OUTPUT);

  // Inital state is OFF
  current_state = false;
  setSolenoidState(false);
}

void loop(void) {
  radio.powerUp();

  // Populate packet
  packet.command = 0xF5;
