Go Down

Topic: Problems with serial Print syntax (Read 455 times) previous topic - next topic

SteveB inCO

This is my code to print LF= then insert the random number
Serial.print("LF=", randNumber1);
But I get this error Invalid conversion from 'const char*' to 'long int'
I could switch the variable to short or int but I don't think that is the problem.  Probably a very simple fix that I'm not seeing.

Thanks Steve

mem

the fix is:
Serial.print("LF=");
Serial.print( randNumber1);

SteveB inCO

Thanks that was too simple.  I guess I was trying to reduce the program size.  

Thanks Steve

mem

There are some C++ tricks you can use to print more then one value in a single line of source code, but that doesn't reduce the size of the runtime code and it can be confusing if you are not familiar with C++

You can read more in this thread: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1231224786/all

Go Up