buat 2 shape pada project
tambahkan code di bawah pada typeCode:
type
Procedure LedBlinkUpload;
Procedure LedBlinkDownload;
buat procedure pada project
Code:
procedure TForm1.LedBlinkUpload;
begin
shape1.Refresh;
if shape1.brush.color=clSilver then
begin
shape1.brush.color:=$0007F513;
end else
begin
shape1.brush.color:=clSilver;
end;
end;
procedure TForm1.LedBlinkDownload;
begin
shape2.Refresh;
if shape2.brush.color=clSilver then
begin
shape2.brush.color:=$000404DD;
end else
begin
shape2.brush.color:=clSilver;
end;
end;
Sisipkan code berikut pada request dan respons
Request
Code:
procedure TForm1.IndyTCPExecute(AThread: TIdMappedPortThread);
begin
LedBlinkUpload;
end;
Ressponse
Code:
procedure TForm1.IndyTCPOutboundData(AThread: TIdMappedPortThread);
begin
LedBlinkDownload;
end;
Sign up here with your email
ConversionConversion EmoticonEmoticon