Native read GPIO pin function. lazarus / 32-Linux ---------------------------------------------------------------------- pascalbythree · 2023-09-04 14:53 Hey everybody, does anyody know how to convert this procedure to a read PIN function; Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i     { Swith SoC pin 17 on: }    gReturnCode := fpsystem('echo "1" > /sys/class/gpio/gpio17/value');    LogMemo.Lines.Add(IntToStr(gReturnCode)); as seen in this wiki: https://wiki.freepascal.org/Lazarus_on_Raspberry_Pi#Native_hardware_ac cess i want to use the fpsystem procedure and if you will take a closer look at te website, it is only described to use by a fpopen Please reply without using hwiringpi, PX,L etc. I would like to use native code. Greets, Wouter van Wegen To get more response, this is the project photo: It is because PXL does not compile on my brand new RPI4, and i want to shift over to native code from here to control upcomming problems... ---------------------------------------------------------------------- ojz0r · 2023-09-04 17:20 Why do you want to use fpsystem call instead of a concrete working example with fpopen? ---------------------------------------------------------------------- ccrause · 2023-09-04 18:48 I've recently started testing the IOCTL native interface, see e.g. this discussion on why it is supposed to be a "better" alternative.  A simple demo using gpio.pas. ---------------------------------------------------------------------- MarkMLl · 2023-09-05 06:22 Quote from: ccrause on September 04, 2023, 08:48:45 pmI've recently started testing the IOCTL native interface, see e.g. this discussion on why it is supposed to be a "better" alternative.  A simple demo using gpio.pas. Thread at https://forum.lazarus.freepascal.org/index.php/topic,56063.m sg416733.html#msg416733 applies. It's better than going through the /sys/class etc. tree, but when I looked at it the API was far from stable. *HOWEVER* it's applicable to more than just RPi, and I consider that to be an important consideration. MarkMLl