I had written routines using testbit to test for a button pressed then temp := 1; then look for button depress and temp = 1 to do a function and reset temp := 0;
example below
Code: Select all
case P_Flag of
12 : begin
if (TestBit(gpio, SW_1) = 1) then temp2 := 1;
if (temp2 = 1) and (TestBit(gpio, SW_1) = 0) then
Begin
inc(Set_A); temp2 := 0;
EEprom_Write(1, Set_A);
end;
end;