Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can someone help a bit on this code? #1

Open
agustin172 opened this issue Nov 21, 2022 · 2 comments
Open

Can someone help a bit on this code? #1

agustin172 opened this issue Nov 21, 2022 · 2 comments

Comments

@agustin172
Copy link
Owner

agustin172 commented Nov 21, 2022

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
65f9f0dce5739710163cbef86104121da4544278

@agustin172
Copy link
Owner Author

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.

@wdcapl
Copy link

wdcapl commented Oct 19, 2024

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants