Interrupt code besides wiringpi and pascalio lazarus / 32-Linux ---------------------------------------------------------------------- pascalbythree · 2022-03-12 17:23 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 program Project1;uses fpgpio;var  pin_21: TGpioPin;  NewValue: Boolean;begin  pin_21 := TGpioLinuxPin.Create(21);  pin_21.Direction := gdIn;  pin_21.InterruptMode := [gimRising, gimFalling];  try    repeat      if input.WaitForInterrupt(TGpioLinuxPin.INTERRUPT_WAIT_INFINITE, NewValue) then        Writeln('Interrupt on Pin ', input.PinID, ' with value ', NewValue)      else        WriteLn('Timeout');    until False;  except    // e.g. on sig int    pin_21.Destroy;  end;end.     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 wiringPiSetupGpio;   wiringPiISR(19,INT_EDGE_FALLING,@WVW_TEST_PROCEDURE); Hey freepascal Crew, does anybody have short example code to interrupt your GPIOPIN on fpc for raspberry ? On PascalIO it works, but it only needs to wait for a pinchange, wich is not preferred to unfold incoming signals from my distance sensor HC-SR04 On wiringPI it works, but i can not have a falling and rising in one procedure and it also does not have code for previous pin status. Does anybody know a other component pack? Some native FPC code wil maybe also do. Thank you and Greets, Wouter van Wegen. ---------------------------------------------------------------------- MarkMLl · 2022-03-18 13:57 Are those true interrupts, i.e. handled via the Linux kernel, or simply pins which are periodically polled? MarkMLl ---------------------------------------------------------------------- Thaddy · 2022-03-18 14:18 Quote from: MarkMLl on March 18, 2022, 02:57:42 pmAre those true interrupts, i.e. handled via the Linux kernel, or simply pins which are periodically polled? MarkMLl They are true interrupts in both cases. I may have an example for the second one. Have to look it up, though.l ---------------------------------------------------------------------- MarkMLl · 2022-03-18 14:30 Quote from: Thaddy on March 18, 2022, 03:18:13 pmThey are true interrupts in both cases. I may have an example for the second one. Have to look it up, though.l I'm being cautious. Some I2C/SPI-connected GPIO stuff that I've been looking explains that its interrupts are handled by polling at the driver level, even if they're exposed by the gpiod etc. API as apparent interrupts. MarkMLl