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.
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.