trika03:
I thought of external interrupts too, but I think that arduino has only 3(?) pins on which you can define external interrupts, and I cannot use those...
A standard UNO has 2 external interrupts.Why can't you use them? You still might have the chance to use pin change interrupts though.