A statement like
digitalRead(buttonPin);
Will do nothing, you need to assign the value to a variable
val = digitalRead(buttonPin);
A statement like
digitalRead(buttonPin);
Will do nothing, you need to assign the value to a variable
val = digitalRead(buttonPin);