   // Optional set number of transmission repetitions.
   // rfDevice.setRepeatTransmit(15);
   /*************************  Pins initialisation ****************************/
-  // Allow wake up pin to trigger interrupt on state change.
-  attachInterrupt(digitalPinToInterrupt(MAGNETIC_SWITCH_PIN), wakeUp, CHANGE);
-  // Set the pin to PULLUP so we don't need an additional resistor
-  // WARNING, the order of the instruction matters. attachInterrup will
-  // erase the PULLUP switch, so configure the PULLUP after the 
-  // attacheInterrupt
-  pinMode(MAGNETIC_SWITCH_PIN, INPUT_PULLUP);
   pinMode(RF_DEVICE_PIN, OUTPUT);
   // Just turn useless LED to off
   pinMode(INTERNAL_LED, OUTPUT);

}

void loop() {
  // Go to sleep mode
  LowPower.powerDown(SLEEP_FOREVER, ADC_OFF, BOD_OFF);

  // Check contact state. We assume a normally closed switch.
  boolean newContact = digitalRead(MAGNETIC_SWITCH_PIN);
  // Does the contact status changed since we last check
  if (newContact != contact) {
    // Send the status of the contact on one bit
    //rfDevice.send(contact, 1);
    flashLED();
    // Update the status of the contact
    contact = newContact;
    //Serial.print("pushing to RF device: ");
    //Serial.println(contact);
  }
}

#include <LowPower.h>

/*
 * This example demonstrate how to use the generic 433 Mhz
 * Radio Frequency emitter using the RFSwitch library
 * LowPower is used to decrease power consumption.
 */

RCSwitch rfDevice = RCSwitch();

int SERIAL_COMMUNICATION_SPEED = 9600;  
// Pin on which the RF device is plugged;
int RF_DEVICE_PIN = 12;
// internal LED
int INTERNAL_LED = 13;

void setup() {
  Serial.begin(SERIAL_COMMUNICATION_SPEED);
  /***********************  RF Device initialisation **************************/
  rfDevice.enableTransmit(RF_DEVICE_PIN);
  // Optional set pulse length.
  // rfDevice.setPulseLength(320);
  // Optional set protocol (default is 1, will work for most outlets)
