unsigned long exit status 1 error

I have this error,

while_trail:11:1: error: expected ‘,’ or ‘;’ before ‘void’

void setup() {

^

exit status 1
expected ‘,’ or ‘;’ before ‘void’

Can you help ?

unsigned long time_last = 0;
int interval_one = 5000; // 5 seconds, 1st while loop
int interval_two = 3000; // 3 seconds, 2nd while loop

int T =1; // Frequency in Hz
int T1= 1000/(2T);
int T2= 2
T1

void setup() {
Serial.begin(9600);
delay(150);
}

int ledPin1 = 13; // LED connected to digital pin 13
int ledPin2 = 12; // LED connected to digital pin 12
int ledPin3 = 11; // LED connected to digital pin 11
int ledPin4 = 10; // LED connected to digital pin 11
void setup()
{
pinMode(ledPin1, OUTPUT); // sets the digital pin as output
pinMode(ledPin2, OUTPUT); // sets the digital pin as output
pinMode(ledPin3, OUTPUT); // sets the digital pin as output
pinMode(ledPin4, OUTPUT); // sets the digital pin as output
}

void loop(){
// 1st while loop
time_last = millis(); //obtain reference //1000
while((millis() -time_last) <interval_one){
// time=1/freq for 5 hz time = 0.2 sec = 200 msec
// for 40 hz , time =1/40=0.025 sec = 25 msec = 25000 Microseconds , for 4 valves 6250
// for high freq delayMicroseconds should be used with the limit of 16383

digitalWrite(ledPin1, HIGH); // sets the LED on
digitalWrite(ledPin2, HIGH); // sets the LED on
digitalWrite(ledPin3, LOW); // sets the LED on
digitalWrite(ledPin4, LOW); // sets the LED on
delay(1*T1); // this value = time/number of valves

}
// 2nd while loop
time_last = millis(); //obtain reference // 10000
while((millis() -time_last) <interval_two){
// time=1/freq for 5 hz time = 0.2 sec = 200 msec
// for 40 hz , time =1/40=0.025 sec = 25 msec = 25000 Microseconds , for 4 valves 6250
// for high freq delayMicroseconds should be used with the limit of 16383

digitalWrite(ledPin1, HIGH); // sets the LED on
digitalWrite(ledPin2, LOW); // sets the LED on
digitalWrite(ledPin3, LOW); // sets the LED on
digitalWrite(ledPin4, LOW); // sets the LED on
delay(1T2); // this value = time/number of valves
digitalWrite(ledPin1, LOW); // sets the LED on
digitalWrite(ledPin2, HIGH); // sets the LED on
digitalWrite(ledPin3, LOW); // sets the LED on
digitalWrite(ledPin4, LOW); // sets the LED on
delay(1
T2); // this value = time/number of valves
}

}

while_trail.ino (2.42 KB)

If the compiler tells you

expected ',' or ';' before 'void'

Then there is probably a ';' missing somewhere, usually just where it tells you ...

... and surprise(!) there is a semicolon missing here

int T2= 2*T1

Also, your title does not seem to match the problem you are expressing in the post. Please try to be consistent.

There also seem to be two functions named setup().