Hi guys,
The messages in my code for the operator have to be displayed one time to keep it organized instead of infinite times.
I thought I could realize this with a while statement and a changing variable. See code below.
While statement = 0, the first message will appear.
After that I change statement to 1, so the second while statement will be carried out.
After the messages appear I change statement to 2 and the messages have to stop, because the while statements are false.
However, I only see infinite times the messages of the second while loop. Which fault do I make?
// Variable
int statement = 0;
void setup()
{
// put your setup code here, to run once:
Serial.begin(9600); // Initialize the serial port
}
void loop()
{
while (statement = 0) // Following message will appear one time on screen
{
Serial.println("Wait untill the start position is reached\n");
statement++;
}
while (statement = 1) // Following messages will appear one time on screen
{
Serial.println("Start the engine\n");
Serial.println("Heat up the engine with the throttle knob on the SuperFlow console\n");
Serial.println("When ready turn the engine to full throttle and press start button to start test\n");
statement++;
}
}