Electric motor Reading

Hello,
I am working on my arduino bord for a project. I have an electric motor hooked up and when it spins it shows me the voltage. I added my TFT display. But the problem is i have to convert the sensor value to be read as a voltage. I am not sure on how to do it. I need to apply a formula float voltage= sensorValue * (5.0 / 1023.0); so i will see the right voltage appear on my screen. But if i add it it gives me a string error and doesnt allow me to use a float. How can i fix this?

test.ino (1.71 KB)

You could post the code and the exact error message.

AustinBakker: I need to apply a formula float voltage= sensorValue * (5.0 / 1023.0);

analogRead() returns an int. So read the value into an int variable (rather than a String) and then do the maths

It is not a good idea to use the String (capital S) class on an Arduino as it can cause memory corruption in the small memory on an Arduino. Just use cstrings - char arrays terminated with 0.

...R