There you have it, then; it should be like this:
unit Unit3;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils;
function getPedalInput(Param: pointer): ptrint;
procedure startPedalThread;
implementation
uses unit1;
function getPedalInput(Param: pointer): ptrint;
var
pedalInput: TFileStream;
begin
pedalInput:=TFileStream.Create('/dev/usb/hiddev0',fmOpenRead);
while True do begin
if pedalInput.Size>0 then
Unit1.Form1.Memo1.Lines.Add('pressed');
end;
getPedalInput:=0;
end;
procedure startPedalThread;
begin
BeginThread(@getPedalInput);
end;
end.
That compiles right.
Thought I don't see where the " 'BEGIN' expected ..." error comes from, to be honest ...
A small nitpicking: since it's called internallly only you don't need to have
getPedalInput() declared in the interface section. Other than that, it looks about correct
ETA: Of course, you should have a public TThreadId var somewhere to store the result of BeginThread and be able to manage the thread from elsewhere, and
getPedalInput() should have some way of exiting the loop and terminate the thread when desired, but I guess this is just a first aproximation and you'll flesh it up some more in the near future, won't you?