     digitalWrite(LED, LOW);
 }
 
+void send_morse(char *sym, char *str)
+{
+    display.print(sym);
+    display.display();
+    Serial.print(sym);
+
+    if (*str++ == '.')
+        beep(dot_msec);
+    else
+        beep(dash_msec);
+
+    while (*str) {
+        delay(dot_msec);
+
+        if (*str++ == '.')
+            beep(dot_msec);
+        else
+            beep(dash_msec);
+    }
+}
+
+void send_char(int c)
+{
+    if (isspace(c) || ! isprint(c))
+        c = ' ';
+    else if (isalpha(c) && islower(c))
+        c = toupper(c);
+
+    switch (c) {
+    default:
+        return;
+    case ' ' :
+        if (! space_seen) {
+            display.print(" ");
+            display.display();
+            Serial.write(c);
+            delay(dot_msec + pause_msec);
+        }
+        space_seen = 1;
+        return;
+
+    case 'A': send_morse("A", ".-");     break;
+    case 'B': send_morse("B", "-...");   break;
+    case 'C': send_morse("C", "-.-.");   break;
+    case 'D': send_morse("D", "-..");    break;
+    case 'E': send_morse("E", ".");      break;
+    case 'F': send_morse("F", "..-.");   break;
+    case 'G': send_morse("G", "--.");    break;
+    case 'H': send_morse("H", "....");   break;
+    case 'I': send_morse("I", "..");     break;
+    case 'J': send_morse("J", ".---");   break;
+    case 'K': send_morse("K", "-.-");    break;
+    case 'L': send_morse("L", ".-..");   break;
+    case 'M': send_morse("M", "--");     break;
+    case 'N': send_morse("N", "-.");     break;
+    case 'O': send_morse("O", "---");    break;
+    case 'P': send_morse("P", ".--.");   break;
+    case 'Q': send_morse("Q", "--.-");   break;
+    case 'R': send_morse("R", ".-.");    break;
+    case 'S': send_morse("S", "...");    break;
+    case 'T': send_morse("T", "-");      break;
+    case 'U': send_morse("U", "..-");    break;
+    case 'V': send_morse("V", "...-");   break;
+    case 'W': send_morse("W", ".--");    break;
+    case 'X': send_morse("X", "-..-");   break;
+    case 'Y': send_morse("Y", "-.--");   break;
+    case 'Z': send_morse("Z", "--..");   break;
+    case '0': send_morse("0", "-----");  break;
+    case '1': send_morse("1", ".----");  break;
+    case '2': send_morse("2", "..---");  break;
+    case '3': send_morse("3", "...--");  break;
+    case '4': send_morse("4", "....-");  break;
+    case '5': send_morse("5", ".....");  break;
+    case '6': send_morse("6", "-....");  break;
+    case '7': send_morse("7", "--...");  break;
+    case '8': send_morse("8", "---..");  break;
+    case '9': send_morse("9", "----.");  break;
+    case '.': send_morse(".", ".-.-.-"); break;
+    case ',': send_morse(",", "--..--"); break;
+    case '?': send_morse("?", "..--.."); break;
+    case '/': send_morse("/", "-..-.");  break;
+    case '=': send_morse("=", "-...-");  break;
+    }
+    space_seen = 0;
+}
+
+void send_message(const char *str)
+{
+    while (*str) {
+        send_char(*str++);
+        delay(pause_msec);
+    }
+    // TODO: fix scrooling
+    display.print("=\n");
+    display.display();
+    Serial.println(" =");
+    delay(dot_msec + pause_msec);
+    send_morse("", "-...-");
+    delay(dot_msec + pause_msec);
+}
+
 void loop()
 {
-    counter++;
-    display.clearDisplay();
-    display.setCursor(0, 20);
-    display.print("Send ");
-    display.print(counter);
-
-    display.setCursor(0, 42);
-    display.print(LoRa.getSignalBandwidth());
-    display.display();
-
+    send_message("KK6ABQ/B");
+#if 0
     // Measure timing.
     unsigned long t0, t1, t2, t3, t4, t5, t6, t7;
-    t0 = micros(); send(300); t1 = micros(); delay(300);
-    t2 = micros(); send(100); t3 = micros(); delay(300);
-    t4 = micros(); send(100); t5 = micros(); delay(300);
+    t0 = micros(); send(300); t1 = micros(); delay(100);
+    t2 = micros(); send(100); t3 = micros(); delay(100);
+    t4 = micros(); send(100); t5 = micros(); delay(100);
     t6 = micros(); send(300); t7 = micros(); delay(900);
-
-    Serial.printf("%u: %u %u %u %u %u %u %u %u\r\n", counter, t0, t1, t2, t3, t4, t5, t6, t7);
-}
+    Serial.printf("%u %u %u %u %u %u %u %u\r\n", t0, t1, t2, t3, t4, t5, t6, t7);
+#endif
+}

//
#define FREQ_HZ 433575000   // 433.575 MHz

unsigned int counter = 0;

//
// On Lora32 module, OLED reset signal is connected to gpio16.
//
Adafruit_SSD1306 display(16);

void setup()
{

        while (1)
            ;
    }
    LoRa.setSignalBandwidth(41700);
    LoRa.setCodingRate4(5);
    LoRa.setSpreadingFactor(6);
    LoRa.disableCrc();
