Overview: The sender and receiver side is set such that when a push button is pressed, the light on the receiver toggles.

Sender Circuit:

Sender Circuit

Sender Circuit

Sender Code:

Intercom/Step_1_ESPNow_Sender at main · mahrukhtauseef/Intercom

Receiver Circuit:

Receiver Circuit

Receiver Circuit

Receiver Code:

Intercom/Step_1_ESPNow_Receiver at main · mahrukhtauseef/Intercom

Code in Action:

Code in Action

Code in Action

<aside> ⚠️

I had a small issue. Sometimes, while pressing the button, it could flicker even if you are trying to press it just once.

</aside>

<aside> 💡

What you want in this case is to not let the button act up again when you are in the process of pressing the button. I did a quick test to see how many times can I press the button in a minute. It came out to 117. This means that each press is taking me ~500 ms. So once a button goes from high to low, I check if the time difference since last press is more than 500 ms. If it is, I allow the button press logic to work.

</aside>

I declared two global unsigned long int, startTime and endTime

unsigned long startTime;
unsigned long endTime;