Skip to content

Commit

Permalink
Minor bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
NT7S committed Jan 27, 2019
1 parent 46663ab commit d386374
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 7 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down Expand Up @@ -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.
*
*/
Expand Down Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions examples/morse_example_avr/morse_example_avr.ino
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
*
* Copyright (C) 2018 Jason Milldrum <milldrum@gmail.com>
*
* 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
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=Etherkit Morse
version=1.1.0
version=1.1.1
author=Jason Milldrum <milldrum@gmail.com>
maintainer=Jason Milldrum <milldrum@gmail.com>
sentence=Generate Morse Code for transmission on an digital I/O pin.
Expand Down
22 changes: 18 additions & 4 deletions src/Morse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit d386374

Please sign in to comment.