Hello, I am a beginner and finding a problem. I wrote the following code and had error message “cannot convert from float to int”.
void serialEvent (Serial Port)
{
brightness = float(port.readStringUntil('\n'));
n=int(brightness);
m=map (n,0,40,1,14);
}
I have already before setup function declared m and n as integer. Where is the problem? Thanks everyone.