¿ªÔÆÌåÓý

Re: CW Mistakes


 

Jerry

I strongly agree with you.? Code organization and functions that contain blocking
code are important and a PITA.? At present I am working on code for some test equipment (Arduino based) which involves a main loop that has some serious timing
constraints.? Slow operation in my initial code was fixed when I converted blocking routines to non-blocking and then spaced the slower sections equally around the
loop, taking care to duplicate critical routines so that they appear multiple times in
a single pass around the loop.

When I added timing discovery points it revealed what was slowing things down
and indicated just where things needed to be moved, deleted, or changed.? In the
process of timing discovery I almost made a real-time version of my code, but
not quite.? John helped me with scaffolding which allowed my DEBUG routines
to become "if DEBUG" so that a compile could include or not include the DEBUG
parts.? Thanks John.? That was a big help.

Some of the C++ based library calls in the Arduino IDE appear to be poorly
constructed for my particular needs.? This caused me to rewrite a few of these
calls.? I think the lesson here is that the Arduino libraries in the IDE should not
be taken as the sacred last word in how to do things.? If you need a special
function call, do not be afraid to write it yourself.? These type things can then
be included in your code and do not need to be formalized and stored as
a library.

Arv
_._


On Sun, May 16, 2021 at 8:23 AM Jerry Gaffke via <jgaffke=[email protected]> wrote:
I had that wrong.??
PARIS is 50 "dot elements", the spaces between the dots count as separate dot elements.
So 20wpm is a rising or falling edge every 1/16.66 = 60 milliseconds, not 30.

With properly organized code, a Nano should have no trouble keeping up.
However, reliably catching that first dot when the processor might be busy doing other stuff
probably does require an interrupt driven digital pin for the key.

Jerry, KE7ER


On Sun, May 16, 2021 at 06:25 AM, Jerry Gaffke wrote:
So 20wpm is 20*50/60 = 16.66 dots/sec, a rising or falling edge every 1/(2*16.66) = 30 milliseconds.

Join [email protected] to automatically receive all group messages.