Recent

Author Topic: Linux examples using LazSerial ?  (Read 14786 times)

wbeppler

  • New member
  • *
  • Posts: 9
Re: Linux examples using LazSerial ?
« Reply #15 on: January 16, 2017, 09:57:33 am »
hi,
i used lazserial in past. it works fine.
you have to be shure that the serial port works, so try a connection with a software like a terminal to a serial connection of another computer like your laptop under any system.
if your serial connection works fine, then search the mistake at lazserial.
if you connect arduino in a new linux it is possible to get a port like /dev/plugandplaybullshit and not /dev/tty01 so i don't know the real portname
try using neutral tools like a terminal-programm and a non-arduino, after this it will work, lazserial is great !
best regards
w

HatForCat

  • Sr. Member
  • ****
  • Posts: 293
Re: Linux examples using LazSerial ?
« Reply #16 on: January 17, 2017, 07:11:23 pm »
Hopefully soon I'll add a third!

Paul, while you are at it, can I suggest the following changes I have just made.

Code: [Select]
******************************************************
File: LazSerialSetup
******************************************************

//procedure EditComPort(ComPort: TlazSerial);
function EditComPort(ComPort: TlazSerial) : Boolean;

//procedure EditComPort(ComPort: TLazSerial);
function EditComPort(ComPort: TLazSerial) : Boolean;
begin
  Result:=False;
  with TComSetupFrm.Create(nil) do
  begin
    ComComboBox1.Text := ComPort.Device;
    //...
    if ShowModal = mrOK then
    begin
      Result:=True;
      //...
    end;

and...

******************************************************
File: LazSerial
******************************************************

//    procedure ShowSetupDialog;
    function ShowSetupDialog : Boolean;

//procedure TLazSerial.ShowSetupDialog;
function TLazSerial.ShowSetupDialog : Boolean;
begin
  Result:=EditComPort(self);
end;

******************************************************
Usage
******************************************************

procedure TForm1.Button2Click(Sender: TObject);
begin
  ser1.BaudRate:=br115200;
  if ser1.ShowSetupDialog then
  begin
    ser1.Device:='/dev/ttyACM0';  // My Brute force for now
    edOpen.Text:=ser1.Device;
    ser1.Open;
    cbPort.Checked:=ser1.Active;
    if not(ser1.Active) then
      ShowMessage('Port-Open failed.');
  end;
end;

Acer-i5, 2.6GHz, 6GB, 500GB-SSD, Mint-19.3, Cinnamon Desktop, Lazarus 2.0.6, SQLite3

 

TinyPortal © 2005-2018