procedure TForm1.SendFreq(RXfreq, TXfreq: Integer; RxOnly:

boolean);

var

RXnumdel, TXnumdel, delta: word;

RXdata, TXdata: TBytes;

begin

if (RXfreq <= VHFmax) then

delta := deltaVHF

else

delta := deltaUHF;

RXnumdel := (RXfreq div 6250) - delta;

TXnumdel := (TXfreq div 6250) - delta;

// RX

setlength(RXdata, 5);

RXdata[0] := 3;

RXdata[1] := RXnumdel shr 8;

RXdata[2] := RXnumdel;

RXdata[3] := $3F;

RXdata[4] := CRC_16(RXdata, 4, $00FF);

SendToMoto(RXdata, length(RXdata));

if (RxOnly) then

exit;

// TX

setlength(TXdata, 5);

TXdata[0] := 2;

TXdata[1] := TXnumdel shr 8;

TXdata[2] := TXnumdel;

TXdata[3] := $3F;

TXdata[4] := CRC_16(TXdata, 4, $00FF);

SendToMoto(TXdata, length(TXdata));

end;