Hai
I got problem with my arduino connecting with comport delphi XE2.
My code could running but no data is displayed on delphi interface..
this is my code on arduino:
int numero;
it's simple program to test that my arduino could connect and show the data on my pc with delphi xe2.
I have tried to fix but still nothing..
anyone could help me?
Does your Arduino program work properly with the Arduino Serial Monitor?
If not, get that working first.
I know nothing about Delphi code and I can't understand yours. A common problem with PC programs is that they are not designed to allow time for the Arduino to reset when the PC program opens the serial port.
rezhart:
Hai
I got problem with my arduino connecting with comport delphi XE2.
My code could running but no data is displayed on delphi interface..
this is my code on arduino:
it's simple program to test that my arduino could connect and show the data on my pc with delphi xe2.
I have tried to fix but still nothing.. :confused:
anyone could help me?
Thanks
Default Windows expects DSR, CTS to be set before communications will happen.
Make sure you turn off flow control.
unit Unit1;
interface
uses
 Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
 Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, CPort;
type
 TForm1 = class(TForm)
  ComPort1: TComPort;
  Button1: TButton;
  Button2: TButton;
  Button3: TButton;
  Memo1: TMemo;
  procedure Button2Click(Sender: TObject);
  procedure Button1Click(Sender: TObject);
  procedure Button3Click(Sender: TObject);
  procedure Rx(Sender: TObject; Count: Integer);
 private
  { Private declarations }
 public
  { Public declarations }
 end;
var
 Form1: TForm1;
 Str: String;
 serin: String;
 implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
  ComPort1.Open;
   button1.Caption:='Connected';
   ComPort1.Connected:=True;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
ComPort1.ShowSetupDialog;
end;
procedure TForm1.Button3Click(Sender: TObject);
begin
if Comport1.Connected then comport1.Connected:=False;
application.Terminate;
end;
procedure TForm1.Rx(Sender: TObject; Count: Integer);
begin
 ComPort1.ReadStr(Str, Count);
 Memo1.Lines.Add(Str);
end;
end.
I gave rezhart a detailed description how to make it work in Delphi but got no response over days. So I deleted that post yesterday what seems to early
Rezharts Delphi code will never work cause a lack of understanding serial communication.
I will not repeat all the steps necessary to make things running but he should try out the command processor component (ComDataPacket) in addition to the comport component. For that component he should set startstring to asc10 and stop string to asc13 within the code and handle the ready to use incomming strings within the OnPacket event. Nothing more to do and just a few lines of code.
Albert_M:
I gave rezhart a detailed description how to make it work in Delphi but got no response over days. So I deleted that post yesterday what seems to early
Rezharts Delphi code will never work cause a lack of understanding serial communication.
I will not repeat all the steps necessary to make things running but he should try out the command processor component (ComDataPacket) in addition to the comport component. For that component he should set startstring to asc10 and stop string to asc13 within the code and handle the ready to use incomming strings within the OnPacket event. Nothing more to do and just a few lines of code.