i have a program which generates morse code using 2 capacitance plates with a nano ,now this works
i have added a binary tree to hold the letters, left insert a dit right insert a dah this works
but i cannot figure out how to display the morse letters that I key how to program the morse sent to display on a lcd screen i am using i2c.
some opinion on how to handle the display would be helpful i get the keydown time
but how to get the keyup time for each letter obvious there could be up to 5 combinations of morse code to a letter.
steve
You have to detect dot, dash, letter-pause, word-pause.
For dot and dash you can preset a tree in which you can track the currently received character:
root+dot -> E; root+dash -> T;
E+dot -> I; E+dash -> A; E+pause -> return('E');
...
Foremost; I trust your knowledge and expertise, so I am asking more than stating. I thought I was only filling a small gap in your information, but it seems I have not heard your spacing ?requirements?.
If the sender's intra-element gap and intra-character gap are the same, what mechanism will allow the receiver separate characters?
Stop bits. My comm circuits relied on them. I do not understand the correlation.
well done after a whole weekend and a few nights of frantic programming i never thought of the gap i was more interested in time taken rather than delay time
to shed some light on usage of morse the spacing is not set in stone as hand morse can be anything or worse but the important bit is its a musical note rather than dots and dashes so its easy to read badly sent morse. but for this i am using defined standards
so dit is 1200 / words per minute so i am looking for a delay of 3 dits and a spacing of
5 dits for a word
test for a 3 dit space if true check for word spaces.if not display letter sounds simple now, oh dear i'll get my coat
steve
what i have is an 16x2 display to display the morse speed this works fine
i just wanted to display the morse being sent i am using capacitance to send the morse instead of a very expensive paddle key .
i am trying to figue out a counter to count morse?
Maybe only start interpreting a group of symbols when you have a gap long enough to indicate that a complete letter e.g. "--.-" (Q) has been received.
This is some rough pseudocode which indicates a possible way to do it.
uint32_t lastDotOrDashAtMs = 0 ;
char charBuf[30] = {0} ; // holds alphaNumweric word e.g. abc012 etc.
char symbolBuf[6] = {0} ; // holds '.' | '-' // may 5 symbols
uint32_t wordGap = 3000UL ; // 3 sec
uint32_t symbolGap = 1000UL ; // 1 sec
loop() {
symbol = getNewDotOrDash() ; // returns '.' | '-' | 0 (0 is no new symbol)
if ( symbol ) {
// we have a dot or dash
gapMs = millis() - lastDotOrDashAtMs ;
lastDotOrDashAtMs = millis() ;
if ( gapMs > wordGap ) {
print( charBuf ) ;
clear( charBuf ) ;
clear( symbolBuf ) ;
{
else if ( gapMs > symbolGap ) {
interpret symbolBuf // your BTree analyser here
add interpreted alphNum character to charBuf
clear( symbolBuf ) ;
}
// normal case
add symbol to symbolBuf
}
if ( millis() - lastDotOrDashAtMs > 5000UL && charBuf not Empty ) { // 5 seconds
// we've had no symbol for 5 secs so flush out all buffers and clean
print( charBuf ) ;
clear( charBuf ) ;
clear( symbolBuf ) ;
}
}
English, i want to do both but from the capacitance key i have not installed the actual
keying circuit i intend to use the buzzer routine to key the ic, which is a 4N26 ic
I have the b tree working and the keying circuit
problem is i dont know how to join the two together to get an output if that makes sense.
i am not a programmer just a hobby and not very good with c although i can justabout
use it.
in 1 routine i get keydownMillis then in the bottom of the loop get the lastmillis the difference between lastMillis and the keydownMillis is 603 milliseconds so its a dah
with a dah spacing at 12wpm so i am not sure how to detect a spacing other than adding a figure to one of the two does any of this help sorry for not figuring out how to edit a post.
i figured it out, took a while, but testing the time taken in each of the functions i got a small figure ie 1 -5
it was just a matter using if statements of these values to plot the movement of the btree. my head hurts don't do enough c but i should get better with time
steve