Error compiling for board Arduino Uno error

Hello all,

I've been coding odd-job projects for college and work, and I've written a fairly simple piece of code that handshakes serial data with Processing so I can test small 24v relays until they fail. I've been trying to compile the program for the Uno but I've been getting the compiling error. See my code below:

  int powerinput = 3;
  
  int poweroutput = 2;
  
  long Timer;
  
  long CurrentTimer;
  
  long LastTimer;
  
  long DelayOnTimer;
  
  long StartTime;
  
  long EndTime;
  
  long DelayOffTimer;
  
  long totalTime;

  boolean failure = false;
  



void setup()
{
  Serial.begin(9600);
  pinMode(powerinput, INPUT);
  pinMode(poweroutput, OUTPUT);
  
}
    
void writeData()
 
 {
       while ((failure = false) && (Serial.available() <= 0));
       {
         
         digitalWrite(poweroutput, HIGH);
         
         int i = i + 1;
         
         LastTimer = millis();
         
         Timer = LastTimer;
         
         Serial.write(i);
         
         CurrentTimer = LastTimer;
         
         DelayOffTimer = CurrentTimer - Timer;
         
         digitalRead(powerinput);
         
         if(powerinput == HIGH)
         {
           CurrentTimer = LastTimer;
           
           DelayOnTimer = CurrentTimer - Timer;    
           
           Serial.write(DelayOnTimer);
           
           if(i=1)
             {
               
               StartTime = Timer;
             
               Serial.write(StartTime);
             
             }
           
           delay(1000);
           digitalWrite(poweroutput, LOW);
         }
         else if(powerinput == LOW and DelayOffTimer > 10000)
         {
           failure = true;
           Serial.write("failure");
           EndTime = CurrentTimer;
           Serial.write(CurrentTimer);
           totalTime = EndTime - StartTime;
           Serial.write(totalTime);
           EOF;
         }
       }
 }

Any and all help is greatly appreciated. Thank you!

failure = false

oops

Don't bother telling us what the error message was - we love guessing games

EOF;

?

while ((failure = false) && (Serial.available() <= 0));
       {
         
         digitalWrite(poweroutput, HIGH);

Is that first semicolon supposed to be there?

int i = i + 1;

if(i=1) Oops

TheMemberFormerlyKnownAsAWOL:

failure = false

oops

Don't bother telling us what the error message was - we love guessing games

EOF;

?

while ((failure = false) && (Serial.available() <= 0));

{
       
        digitalWrite(poweroutput, HIGH);



Is that first semicolon supposed to be there?



int i = i + 1;





`if(i=1)` Oops

The testing sequence is as follows and I haven't finished coding it completely:

24V is sent to the relay
Input into Arduino confirms power into relay.
Input into Arduino confirms power is seen after the relay.
The reaction time of the relay is taken into consideration.
If the relay doesn't react for more than 10 seconds, we can safely assume the relay is kaputt.

I corrected everything you pointed out; I've been working with PLC's too long it seems.