I have a bit of a problem that I have not been able to solve yet.
I have 2 arduinos. 1 sends a signal when low voltage is seen on my alarm (door is open). The other gets that signal and then starts my stereo system for when I return home.
The problem is that I currently have it set up so that it turns on when i leave. This is because the arduino in my closet (the one tied into my security system) senses the low voltage and sends the signal to the arduino next to my music player. Then, the whole thing starts. I need to find a way to disable the receiver function for a time period when i leave.
I have tried to delay reading for messages when i make my escape and it does not solve the issue. As soon as the delay runs out the chip picks up the message from the chip and the music starts. It seems like the message is being held in a buffer or the receiver chip somehow. I need to find a way to wipe all of the messages out of the chip after i have escaped. I have also tried to stop the receiver with (extern void vw_rx_stop() and then I do (extern void vw_rx_start() once i have had ample time to leave the house.
Closet file is the one that picks up low voltage and sends the signal (only when the door is open)
Main hub is the one that does most of the action. It is structured with a switch case for multiple modes. Right now i am only trying to get the first case to work properly.
Once the 1st case is executed the chip is primed to get the signal from the sender. Unfortunately the closet file sends the signal as soon as i leave.
If possible, i would like to only modify the main hub file as the closet file has been working flawlessly.
Any help you can provide will be greatly appreciated.
Main_Hub_File_Rev3.ino (13 KB)
Closet_File_Rev_2.ino (681 Bytes)