markfickett / arduinomorse

Morse for Arduino, with Non-Blocking Sending
48 stars 17 forks source link

How would I go about repeating the send message cycle? #3

Closed Kreetcha closed 8 years ago

Kreetcha commented 9 years ago

I have this code here

include

define PIN_STATUS 11

LEDMorseSender sender(PIN_STATUS); void setup() { sender.setup(); sender.setMessage(String("ech0")); sender.startSending(); } void loop() { sender.continueSending();

}

Is continue sending meant to repeat the cycle or just allow the command to finish?

I want to write a code to send sensor data over CW every so often or on a repeated cycle. I plan on replacing "ech0" with a two digit int value that is read from a temperature sensor. Thanks for any help and thanks for the awesome library! :)

markfickett commented 9 years ago

Hi Kreetcha,

Calling continueSending is intended to keep sending more of the same message you set earlier; it won't repeat anything. When it's done sending the first message you set, it will return false. (All the previous times you call it, it will return true.)

However, if you're not planning to do anything else while sending the temperature, you may not need to use startSending and continueSending. You can call sendBlocking and it will send the full message before the function call returns.

Hope that clears it up, and let me know if you have more questions. Glad you're finding the library helpful!

-Mark

ViliusKraujutis commented 8 years ago

I guess that's clear, @Kreetcha can this be closed?

markfickett commented 8 years ago

I'll go ahead and close it. Please re-open or open a new issue if you have more questions.