Set timer to start and stop program #4
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Calling a "program" anything you want to schedule for the future, like "n minutes on, m minutes off, with this message."
Once RTC chip gets here, this will get more complex.
See https://github.com/contrem/arduino-timer as referenced in #3.
I wrote some code and then tested it. The problem with arduino-timer is that it (as it is supposed to) doesn't block, or at least I can't make it.
Here is an idea: https://github.com/contrem/arduino-timer/discussions/53#discussioncomment-1269463
timer.every(shortestNoteLength, continuePlayingMySong);
In this example,
continuePlayingMySong()
would increment (internally?) and then know what it was supposed to be doing. So in terms ofK
, it would be something like111010111
for timing, with 1 being gpio on and 0 being off.Maybe increments would look like this example?
I am also looking at other timing libraries; this one might not be the best for this part of the project.
To summarize, there are a few places where timers are needed:
For the first two,
arduino-timer.h
looks really useful.For the last (which I need to code first), it looks like I can do one of these
millis()
to track time inside a function withwhile
Switch_lib
Maybe stop trying to reinvent the wheel.
Found a bunch I couldn't make work.
Telegraph works, but uses delay(). Sigh. https://git.kj7rrv.com/kj7rrv/Telegraph/src/branch/main/Telegraph.cpp
ETA: This might be OK. The webserver is asynchronous, so I'm able to enter a new value into the webform to control whether the message sends, and it gets caught in
if()
on the nextloop()
. You just can't (yet) stop the message in the middle, but for this application you would have to wait less than a minute at most.Unless you want it running continuously for training, hmm. Weighing the perfect and the good here.
Errors in arduinomorse:
JLED looks like a winner! I can start and stop sending midstream from the webui.
Sometimes it stops with the LED on, so will need to fix that.
This issue has gotten a bit muddled, but I will note that as of
3977971341
, I can control whether a gpio/LED is sending a Morse message or not from the web UI.use #3 to discuss sending code
use this issue to discuss scheduling program start
Set timer to start and stop keying radioto Set timer to start and stop programClosed in #24.
Hi! I'm the developer of the Telegraph library. It looks like you found a solution, but if you ever want to use Telegraph but it doesn't do everything you'd need, feel free to submit an issue or PR on its repo. 73
@kj7rr, thanks for the work you've done. I'll think about any changes I might make, but this whole codebase is pretty much me learning by breaking things!