#include <RF24.h>
#include <nRF24L01.h>
#include <RF24_config.h>
#include <printf.h>

int switches = 0;
/*
*Arduino Final Bomb Pedistal
*Lucas Dahl
*2/6/2018
*
*/

RF24 radio(7, 8); // CE, CSN
const byte address[6] = "00002";
void setup() {
  radio.begin();
  radio.openWritingPipe(address);
  radio.setPALevel(RF24_PA_MIN);
  radio.stopListening();
  pinMode(4, INPUT);
  Serial.begin(9600);
}
void loop() {
  const char finaldoor[] = "opendoor";
  switches = digitalRead(4);
  if (switches == HIGH){
      radio.write(&finaldoor, sizeof(finaldoor));
      Serial.println("Door Open");
  }

  delay(1000);
}
