# Morse component: optional header-files lesson

Target: two 5V Arduino Uno R3 boards (ATmega328P, default timer settings).
Receiver: upload MorseComponent/MorseComponent.ino; uses onboard LED and input D2.
Sender: open HelloMorse/HelloMorse.ino with MorseBlinker.h and MorseBlinker.cpp beside it.
Wire sender D9 -> receiver D2; join GND. Power each board by its own USB.
Do not join their 5V rails when both have separate USB power.
Start the receiver first, then reset the sender. The message runs once.
MorseHandler/MorseHandler.ino is the earlier standalone sender stage, not another file to add to HelloMorse.

The code uses international dot/dash patterns with custom classroom timing (200 ms dots,
400 ms dashes, 50 ms buffers, 1000 ms pauses). It is not standard Morse timing.
Adjacent pulses each have a leading/trailing buffer, making 100 ms between marks.
The transport is deliberately slow: hold each PWM command for 80 ms, then idle HIGH for
3000 ms. The maximum blink sequence is 2500 ms. This avoids overlapping commands and
allows repeated letters. There is no acknowledgment/retry; startup loss/noise may lose data.
If blink timings change, increase the sender wait accordingly. Do not use Servo.h or
anything that changes Timer1 on the sender while using D9 PWM in this example.

Supported input: A-Z, a-z, 0-9 and ASCII space. Other characters are ignored.
Space always sends a pause. The optional bool adds another pause after the call.
blinkStr expects a null-terminated C string; for an Arduino String use text.c_str().
Commands occupy 0-221 in six-value bins; encoder sends bin center index*6+3.
Values 222-254 are unused; 255 (steady HIGH) is idle. Encoder never sends 0 (steady LOW).
Receiver measures HIGH/LOW pulse lengths; analogRead is not a PWM decoder.

API: beginMorse(9), blinkChar('A', false), blinkStr("hello world", true).
The .h declares the interface; .cpp implements it. Both compile into the sender firmware.
Component firmware runs separately on the receiver board.
