small medium large xlarge

Back to: All Forums  Arduino
Ray_pragsmall
02 Mar 2011, 18:01
Ray Fleischmann (3 posts)

Hello Everyone, Am I WRONG in thinking that send_message is sending ONE character at a time to output_code. AND if that is TRUE the why does output_code have this: for (int i = 0; i < strlen(code); i++) { when the value for strlen(code) will always be 1. What am I getting wrong????? Regards to All, -Ray F.

Maik_schmidt_avatar2_pragsmall
02 Mar 2011, 18:59
Maik Schmidt (122 posts)

Hi Ray!

The output_code() function emits either an element of the LETTERS array or an element of the DIGITS array. Both arrays contain strings having a length of one to five characters. To see the effect in the serial monitor add the following statement to the beginning of output_code():

Serial.println(strlen(code));

Best,

Maik

Ray_pragsmall
02 Mar 2011, 19:31
Ray Fleischmann (3 posts)

OH, it is the Morse Code that it sends. I get it. -Thanks

Ray_pragsmall
02 Mar 2011, 20:04
Ray Fleischmann (3 posts)

AND I added a delay at the BOTTOM of output_symbol delay(length * 3); because it was looping so fast that led on too long. This makes it better. -Ray F.

Maik_schmidt_avatar2_pragsmall
02 Mar 2011, 20:07
Maik Schmidt (122 posts)

We had a similar discussion in http://forums.pragprog.com/forums/129/topics/8633.

Getting the timing right is a tricky problem when using Morse code.

Cheers, Maik

You must be logged in to comment