mire tome un ejemplo para empezar a programar con lazarus de la pagina http://wiki.freepascal.org/Lazarus_on_Raspberry_Pi , luego modifique el código en concreto quería hacer que al cargar el formulario me exporte y ponga tipo out a todos los pines ahí esta la modificación que ice , la array la puse arriba , aun que aquí no se vea
procedure TForm1.FormActivate(Sender: TObject);
var
fileDesc: integer;
x:integer;
begin
PINS[1]:= '2';
PINS[2]:= '3';
PINS[3]:= '4';
PINS[4]:= '7';
PINS[5]:= '8';
PINS[6]:= '9';
PINS[7]:= '10';
PINS[8]:= '11';
PINS[9]:= '14';
PINS[10]:= '15';
PINS[11]:= '17';
PINS[12]:= '18';
PINS[13]:= '22';
PINS[14]:= '23';
PINS[15]:= '24';
PINS[16]:= '25';
PINS[17]:= '27';
for x := 1 to 17 do begin
try
fileDesc := fpopen('/sys/class/gpio/export', O_WrOnly);
gReturnCode := fpwrite(fileDesc, PINS[x], 2);
LogMemo.Lines.Add(IntToStr(gReturnCode));
finally
gReturnCode := fpclose(fileDesc);
LogMemo.Lines.Add(IntToStr(gReturnCode));
end;
{ Set SoC pin 17 as output: }
try
fileDesc := fpopen('/sys/class/gpio/gpio'+ PINS[x] +'/direction', O_WrOnly);
gReturnCode := fpwrite(fileDesc, OUT_DIRECTION[0], 3);
LogMemo.Lines.Add(IntToStr(gReturnCode));
finally
gReturnCode := fpclose(fileDesc);
LogMemo.Lines.Add(IntToStr(gReturnCode));
end;
end;
end;
alguno me puede ayudar con esta parte del código