Can't write data into variable

Explain the problem.

We strongly recommend to avoid using Strings with Arduino. Your program will eventually crash due to memory problems.