int i = 0;
while (digitalRead(ButtonPin))
{
i++; // how much the button has been held
}
How much what? Chocolate ice cream? That code is NOT measuring HOW LONG the switch was held down.
int i = 0;
while (digitalRead(ButtonPin))
{
i++; // how much the button has been held
}
How much what? Chocolate ice cream? That code is NOT measuring HOW LONG the switch was held down.