Hi,I try to count a HIGH / LOW state of a signal.The parts of the code (analog signal to digital signal) works.Count-part in another sketch (standard arduinosketch ButtonStateChange) worksBut in the total sketch the count-part don't work.

Anyone an idea? (of course... i'm still a very newbee...)Below the code

boolean signal;int sensorvalue;int signalCounter = 0; // counter for the number of button pressesint signalState = 0; // current state of the buttonint lastsignalState = 0; // previous state of the button

That's what digitalRead does - read the state of a pin. You're telling the function to read from the pin number that Signal holds, which will be 0 or 1. That's bad news because you are using the hardware Serial port, which also uses those pins. Which pin is your button attached to?