Convert data serial Port

Hi,

I would like to use the serial port to control the flashing of a led.
Principle: I send the delay between the character “a” and ";"by terminal.
To do this, I record data, byte by byte, in a char variable and I convert it to int.

Someone could tell me where my code is wrong.

Thanks for your help.

sketch_feb06a.ino (858 Bytes)

This part is complete nonsense

  int received = Serial.read();          // On les récupère
  
 if(Serial.available() > 0) 
  { 
    if(received == 'a')
    {
      do      
      {  
        Donnee[i] = received;
        i++; 
        delay(100);
      } 
      while(Serial.read() != ';');
    }
  }
  Pause = atoi(Donnee);

Have a look at Serial Input Basics - updated