Open agustin172 opened 2 years ago
the idea is that with a vhf band (118-136 mhz) am handy to receive PTT signals to the Rpi, then use Rpi to control a relay board which again controls some lights. but with a low budget for Latin America regarding small aerodromes that are very important for medical flights, the idea is we need the arduino to read the ppt of the radio from a handy/plane and if you press the ptt four times from another handy vhf you close the relay for 10 minutes and be able to turn on the lights or activate the ptt of the base radio and transmit an automatic message. The idea is to be able to do the project and donate it to the small aerodromes in this region with the help of the local aeronautical authority but I'm working a lot with the code since my Arduino skills aren't the best haha.
@agustin172 Hey. I have a project you might be interested in. https://github.com/wdcapl/nanoawos It can trigger weather announcements or relays with homeassistant.
Can someone help a bit on this code?
My problem is now that millis function is running in background in the set interval regardless of when i toggle the relays, millis function will reset the relays in the time period which is not intentional. I need a clever function to make it work, but lack the thinking. Also I forgot to add (PTTPushCounter = 0); on the last posted code to count as I wanted to reset the pushcounter which fixes the leds not turning of at 3,5,7 or 9 pushes, so that is fixed.
Just need a clever way to measure time when the relays has been turned on, check if the interval is true, if so and then turn the relays off..
is to use a timer library to accomplish a future turn off event. I did this example where the button turns LEDs on and they later turn themselves off https://wokwi.com/projects/345363308263506516 As someone suggested, when you have multiple items that need to run the same way, putting them in an array can end up being really useful
PTTState read