I ran into the following code for a sumo robot. Why is the while(BTN) part used? The code doesn't work without it.
#include <Wire.h>
void setup() {
//button
pinMode(A2, INPUT);
digitalWrite(A2, HIGH);
#define BTN !digitalRead(A2)
void loop() {
Forward(0, 0); //Stop motors
delay(100);
if (BTN) { //Turn on program with button
while(BTN){}
while (!BTN) {
//code for movement is written here, irrelevant
}
while(BTN){}
}
}