//sketch by NicoVarg99 #define SPEED (16) //speed in WPM. Default: 16 #define DOTLEN (1200/SPEED) #define DASHLEN (3*(1200/SPEED)) #define PAUSE 10 //Time in seconds between transmissions int ledPin=13; //Digital pin used to show when the tone is playing. Pin 13 has an attached led on most Arduino boards. int tonePin=3; //Digital pin used to send the tone. It MUST be a PWM pin (Marked with ~). int toneFreq=900; //Tone frequency. Usually between 500 and 900 Hz. void sendMsg(char*); void dash(); void dot(); void setup() { pinMode(ledPin, OUTPUT); Serial.begin(9600); Serial.println("Arduino Morse Beacon"); Serial.println("Written by Nicola Salsotto IN3GJH"); Serial.println("https://github.com/NicoVarg99"); Serial.print("\n"); } void loop() { sendMsg("IN3GJH/B"); //Remember to replace it with your callsign/message! Serial.print("DELAY: "); Serial.print(PAUSE); Serial.println(" s"); delay(PAUSE*1000); } void dash() { digitalWrite(ledPin, HIGH); tone(tonePin, toneFreq); delay(DASHLEN); digitalWrite(ledPin, LOW); noTone(tonePin); tone(tonePin, 21000); delay(DOTLEN); noTone(tonePin); } void dot() { digitalWrite(ledPin, HIGH) ; tone(tonePin, toneFreq); delay(DOTLEN); digitalWrite(ledPin, LOW); noTone(tonePin); tone(tonePin, 21000); delay(DOTLEN); noTone(tonePin); } void sendMsg(char *str) { int i; tone(tonePin, 21000); delay(500); noTone(tonePin); Serial.print("TX: "); for(i=0;i