conversions string to int, long int, unsigned long int, and visa versa.

I need to convert strings to

  • int
  • unsigned int
  • long int
  • unsigned long int

And also translate strings back to those variable types again (visa versa, the other direction)
Is there perhaps a library to do this, or can someone show me how to do those?

https://www.inkling.com/read/arduino-cookbook-michael-margolis-2nd/chapter-2/recipe-2-9

There are a few possibilities for 'float', but there are too many possibilities for integers.

The atoi() and atol() are simple functions for signed integers.

I must admit, I have never used strtoul(), but it seems to exist:
http://www.nongnu.org/avr-libc/user-manual/group__avr__stdlib.html

You could use sprintf and sscanf.
http://www.nongnu.org/avr-libc/user-manual/group__avr__stdio.html

The functions that use the 'Stream' class can convert numbers into strings, and can scan incoming data for numbers.

The String class can do a lot.
http://arduino.cc/en/Reference/StringConstructor

Perhaps I forgot a few. You could also write your own specific function.

Ehm that website you where referring to is that the full list of C command language supported by the Arduino ?
(i always had a bit the feeling that arduino C was a subset of C )

Well sadly those conversions are not all from serial commnications, so i gues i have to use the complex way.
I think then i will just write my own library for the conversions; and maybe use more readable syntax then.

i always had a bit the feeling that arduino C was a subset of C

The Arduino IDE uses a superset of C++ (extra Arduino specific functions added), so the normal C functions supported by C++, such as conversion of data types described in this thread are all available.

i always had a bit the feeling that arduino C was a subset of C

O no, you hurt our feelings. :wink:

PGT2:
Ehm that website you where referring to is that the full list of C command language supported by the Arduino ?

Did you refer to my links like these ?
http://www.nongnu.org/avr-libc/user-manual/group__avr__stdlib.html
That is a link to the actual documentation for the avr-gcc compiler used by the Arduino.

Arduino uses the avr-gcc compiler. That is the full GCC compiler that generates code for avr chips.
http://www.nongnu.org/avr-libc/
There is no 'stdio', and there are a few restrictions for floating point. The floating point is not switched on for the "sprintf" function.

You can do anything in the Arduino microcontroller that you are used to do in 'C' or 'C++'.

I gave you four good options, you might only need one of them, but you can use them all if you like. Why do you even want to write your own conversion code ?