The reason I chose these is that with the arm on, they are very sensitive to the smallest weight touching the arm.
Inside the mailbox they are going to be mounted with the arm pointing upwards, on a little slope, so the mail will slide down and hit the arm before falling down inside the storing compartment inside the mailbox.
To mount them, I am making a bracket like this, where I can screw the switches on each side of it.
const int buttonPin = 0; // Interrupt 0 = digital pin 2
const int debounce = 3000; // How long debounce we want before sending a new message about mail arrived
unsigned long lastMail = 0; // Store when the message was send last time
pinMode(buttonPin, INPUT); // Set pinmode as a input
attachInterrupt(buttonPin, mail, HIGH); // Attach the interrupt pin connected to the switch
//We don't need to loop anything
void mail() //Will be used when the interrupt on digital pin 2 is triggered
if (millis() - lastMail >= debounce) // Debounce
lastMail = millis(); //Store when this last triggered
void rfSend(String message)
vw_send((uint8_t *)output, strlen(output));
vw_wait_tx(); // Wait for message to finish