Hi KMtronic,
used your example with a nano, worked fine, thank you.
but i had some issues with temporary coming up inputs.
i use no external pullup resistors, because of the internal ones.
your code:
pinMode(2, INPUT); // Set pin to input
digitalWrite(2, HIGH); // Turn on pullup resistor
should be:
pinMode(2, INPUT_PULLUP); // Set pin to input and turn on pullup resistor
for my understanding.
since i changed this all the problems are gone.
Thomas