/* Morse.h - Library for flashing Morse code.
Created by Young on Sept. 1, 2016 */
#ifndef Morse_h
#define Morse_h
#include "Arduino.h"
class Morse
{
public:
Morse(int LED);
Morse(, int BEEP);
Morse(, int delayTime);
Morse(, char tmpChar);
void MorseDot();
void MorseDash();
void LightsOff(int delayTime);
void GetChar(char tmpChar);
private:
int _LED;
int _BEEP;
int _delayTime;
char _tmpChar;
int _note;
int _dotLen;
int _dashLen;
int _elemPause;
int _Spaces;
int _wordPause;
};
#endif
#include <Morse.h>
int delayTime;
int tmpChar;
Morse dot();
Morse dash();
Morse dark(int delayTime);
Morse set(char tmpChar);
char stringToMorseCode[] = "N 36° 00.19518 W 084° 13.88856"; //Final Coordinates
// Create variable to define the output pins
int LED = 13; // blink an led on output 12
int BEEP = 14; // output audio on pin 8
int i;
void setup()
{
}
void loop()
{
// Loop through the string and get each character one at a time until the end is reached
for (int i = 0; i < sizeof(stringToMorseCode) - 1; i++);
{
// Get the character in the current position
char tmpChar = stringToMorseCode[i];
// Set the case to lower case
tmpChar = toLowerCase(tmpChar);
// Call the subroutine to get the morse code equivalent for this character
Morse set.GetChar(tmpChar);
}
// At the end of the string long pausepledause before looping and starting again
Morse::
dark.LightsOff(8000); // hold in this position
}
In file included from /Users/Young1DMYoung1/Documents/Arduino/Morse_Library_Test/Morse_Library_Test.ino:1:0:
/Users/Young1/Documents/Arduino/libraries/Morse/Morse.h:13:5: error: 'Morse::Morse(int)' cannotIn befunction overloaded
'void Morseloop(int BEEP);
^
/Users/Young1/Documents/Arduino/libraries/Morse/Morse.h':12
Morse_Library_Test:533: error: with 'Morse::Morse(int)'
Morse(int LED);
^
/Users/Young1/Documents/Arduino/libraries/Morse/Morse.h:14:5:request error:for 'Morse::Morse(int)'member cannot'GetChar' bein overloaded
'set', Morse(intwhich delayTime);
is ^
/Users/Young1/Documents/Arduino/libraries/Morse/Morse.h:12:5:of error:non-class withtype 'Morse::Morse(intchar)'
Morse(int LED set.GetChar(tmpChar);
^
/Users/Young1/Documents/Arduino/Morse_Library_Test/Morse_Library_Test.ino: In function 'void loop()': ^
Morse_Library_Test:3138: error: cannotrequest callfor member function'LightsOff' 'voidin Morse::LightsOff'dark', which is of non-class type 'Morse(int)' without object
Morse::dark.LightsOff(8000);
// hold in this position
^
exit status 1
cannotrequest callfor member function'GetChar' 'voidin Morse::LightsOff'set', which is of non-class type 'Morse(intchar)' without object