   wdt_disable();
   wdt_reset();
   WDTCSR &= ~_BV(WDIE);
+}
+
+// -----------------------------------------
+
+void setSolenoidState(bool open) {
+  digitalWrite(MOTOR_1, !open); // LOW if open
+  digitalWrite(MOTOR_2,  open); // HIGH if open
+
+  goToSleep(WDTO_120MS);
+
+  digitalWrite(MOTOR_1, LOW);
+  digitalWrite(MOTOR_2, LOW);
 }
  // Init motor pins
  pinMode(MOTOR_1, OUTPUT);
  pinMode(MOTOR_2, OUTPUT);
}

void loop(void) {
  // Replace this with Arduino sleep + WDT timeout
  goToSleep(WDTO_8S);

  radio.powerUp();
  // Wait until radio is fully awake
  delay(50);

  // Populate packet
  packet.command = 0xF5;

#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);

// -----------------------------------------

void setup(void) {
  // Serial.begin(9600);
