Meist (ohne interrupt) macht man das mit XOR
Code:
dim old as byte
dim new as byte
dim flanke as byte

do 
  new = pind.2
  flanke = new xor old 
  if flanke = 1 then
         if new = 1 then
            ' rising
         else 
            ' falling
         end if
   end if
  old = new
loop
Beispiel Is nicht elegant , er reichen auch Bit-dims, is nur zur Erläuterung