function defintion not allowed befor

[color=#202124]Hi all

[/color]
[color=#202124]Please I need some help with my program;
 Which allows to manage a square signal of fixed [/color][color=#202124]report 0.5 with a variable frequency as a function of time for mega arduiono
[/color]
[pre]And for the frequency sweep:

[pre][color=#202124]Between 0 and 20 ms [37KHZ]
Between 20ms and 40ms [35KHZ]
Between 40ms and 60ms [33KHZ]
Between 60ms and 80ms [31KHZ]
Between 80 ms and 10s [30KHZ]
Between 10s and 11s [25KHZ]
Between 13s and 14s [15KHZ]
Between 14s and 15s [10KHZ]
Between 15s and inf[6KHZ]

[/color]
My idea here used the microsecond delay function to manage the frequencies and millisecond delay to calculate the time but unfortunately my program does not work. and this is the program I have used before.

[/pre][/pre]

int outPin = 7;                 

void setup()
{
  pinMode(outPin, OUTPUT);      
}

void loop()
{
  digitalWrite(outPin, HIGH);   
  delayMicroseconds(8);        
  digitalWrite(outPin, LOW);   
  delayMicroseconds(8); 

  delay(20);

  digitalWrite(outPin, HIGH);   
  delayMicroseconds(9);        
  digitalWrite(outPin, LOW);   
  delayMicroseconds(9); 

  delay(20);
  
  digitalWrite(outPin, HIGH);   
  delayMicroseconds(10);        
  digitalWrite(outPin, LOW);   
  delayMicroseconds(10); 

  delay(20);
  
  digitalWrite(outPin, HIGH);   
  delayMicroseconds(11);        
  digitalWrite(outPin, LOW);   
  delayMicroseconds(11); 

  delay(20);
  
  digitalWrite(outPin, HIGH);   
  delayMicroseconds(12);        
  digitalWrite(outPin, LOW);   
  delayMicroseconds(12); 

  delay(10000);
  
  digitalWrite(outPin, HIGH);   
  delayMicroseconds(15);        
  digitalWrite(outPin, LOW);   
  delayMicroseconds(15); 

  delay(1000);
  
  digitalWrite(outPin, HIGH);   
  delayMicroseconds(25);        
  digitalWrite(outPin, LOW);   
  delayMicroseconds(25); 

  delay(1000);

   digitalWrite(outPin, HIGH);   
  delayMicroseconds(45);        
  digitalWrite(outPin, LOW);   
  delayMicroseconds(45); 

  delay(1000);

  digitalWrite(outPin, HIGH);   
  delayMicroseconds(75);        
  digitalWrite(outPin, LOW);   
  delayMicroseconds(5); 

  
}

When and where do you see the text of your topic title ?

++Karma; // For posting your code correctly on your first post.

I have compiled your code with no errors.

But karma-- for messing up the rest of the post en not posting the complete error message...

Yes, but

delay(10000);

wastes the considerable power of your Arduino for ten seconds.

Eventually, you may regret this.