It's all a matter of style but I prefer to use { } in place of a ; that could easy be missed or worse miss added.
So:-
while (digitalRead(buttonPin) != HIGH) { }
It's all a matter of style but I prefer to use { } in place of a ; that could easy be missed or worse miss added.
So:-
while (digitalRead(buttonPin) != HIGH) { }