How it works...

When you click on blinkSwitch, one of two commands is sent to Arduino: BLINK_ON or BLINK_OFF, depending on the status of the switch. The fundamental part, the Delphi side, resides in the following function (this allows you to send the command):

procedure TMainForm.blinkSwitchClick(Sender: TObject);
begin
case blinkSwitch.State of
tssOff:
ComPort1.WriteStr('BLINK_OFF');
tssOn:
ComPort1.WriteStr('BLINK_ON');
end;
end;

The preceding code is used for the WriteStr function of TComPort to send the command to Arduino.

Regarding the Arduino Sketch (point 9 of How to do it...), it is appropriate to say a few words: