Reading data from serial like scanf of the C

Is there any function that works like scanf(%d,i). Serial.read() just read char. So i can't put from computer datas like "123", Serial.read() reads 1 as a char and gives corresponding ASCII number.

Hello and welcome,

You have to store those characters in a char array, until a End Of Line character (of your choice, can be \r, \n, or whatever character you want) is read. Then you can use sscanf.

Hi, thank you very much :slight_smile:

guix:
Hello and welcome,

You have to store those characters in a char array, until a End Of Line character (of your choice, can be \r, \n, or whatever character you want) is read. Then you can use sscanf.

Or Serial.parseInt() or Serial.readString() or a number of other ways. Read the documentation. Read the code. Figure out what works for YOU.

Do NOT complain that the only method you KNOW about doesn't do what you want. Learn about the other methods.

Have a look at the examples in serial input basics

...R