diff --git a/README.md b/README.md index e49652a..729ce77 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ Example ------- First, install the Morse library into your instance of the Arduino IDE as described above. -There two simple examples named **morse_example_avr.ino** and **morse_example_samd.ino** that are placed in your examples menu under the Etherkit Morse folder. Open one corresponding to the Arduino variant on which you will be running the example. +There two simple examples named **morse_example_avr.ino** and **morse_example_samd.ino** that are placed in your examples menu under the Etherkit Morse folder. Open one corresponding to the Arduino variant on which you will be running the example. If you are using an AVR-based Arduino (such as an Uno), you'll want to also install the SimpleTimer library found (here)[https://playground.arduino.cc/Code/SimpleTimer]. In order to use the Morse library in your sketch, you must first instantiate an object of class Morse: @@ -112,7 +112,7 @@ void Morse::send(char * message) /* * Morse::reset() * - * Halts and sending in progress, empties the message buffer, and resets the + * Halts any sending in progress, empties the message buffer, and resets the * Morse state machine. * */ @@ -143,6 +143,9 @@ The standard uppercase and lowercase letters 'A' through 'Z' and digits '0' thro Changelog --------- +* v1.1.1 + + * Minor bug and documentation fixes. * v1.1.0 diff --git a/examples/morse_example_avr/morse_example_avr.ino b/examples/morse_example_avr/morse_example_avr.ino index 6772631..96fffb9 100644 --- a/examples/morse_example_avr/morse_example_avr.ino +++ b/examples/morse_example_avr/morse_example_avr.ino @@ -4,6 +4,9 @@ * * Copyright (C) 2018 Jason Milldrum * + * Uses the SimpleTimer library which you can find here: + * https://playground.arduino.cc/Code/SimpleTimer + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or diff --git a/library.properties b/library.properties index f76961c..3050f46 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=Etherkit Morse -version=1.1.0 +version=1.1.1 author=Jason Milldrum maintainer=Jason Milldrum sentence=Generate Morse Code for transmission on an digital I/O pin. diff --git a/src/Morse.cpp b/src/Morse.cpp index ea45a4b..42a56b9 100644 --- a/src/Morse.cpp +++ b/src/Morse.cpp @@ -263,11 +263,23 @@ void Morse::update() case State::DIT: case State::DAH: tx = true; - if(output_pin) + if(dfcw_mode) { + // if(output_pin) + // { + // digitalWrite(output_pin, LOW); + // } digitalWrite(output_pin, HIGH); + digitalWrite(led_pin, HIGH); + } + else + { + if(output_pin) + { + digitalWrite(output_pin, HIGH); + } + digitalWrite(led_pin, HIGH); } - digitalWrite(led_pin, HIGH); if(cur_timer > cur_state_end) { @@ -345,6 +357,7 @@ void Morse::update() // Clear the message buffer when message sending is complete memset(msg_buffer, 0, TX_BUFFER_SIZE + 1); busy = false; + cur_char = 0; if(dfcw_mode) { digitalWrite(led_pin, LOW); @@ -405,13 +418,14 @@ void Morse::send(char * message) /* * Morse::reset() * - * Halts and sending in progress, empties the message buffer, and resets the + * Halts any sending in progress, empties the message buffer, and resets the * Morse state machine. * */ void Morse::reset() { - strcpy((char *)msg_buffer, ""); + // strcpy((char *)msg_buffer, ""); + memset(msg_buffer, 0, TX_BUFFER_SIZE + 1); cur_msg_p = msg_buffer; cur_char = 0; cur_state = State::IDLE;