This is the code which is part of a larger sketch.
1) float az_move = azDist (prevstop_az, az_s);
2) Serial.print (F("\taz_move:\t"));
3) Serial.print(az_move); Serial.print(F("\t"));
4) Serial.print(prevstop_az); Serial.print (F("\t"));
5) Serial.print(azDist); Serial.print (F("\t"));
and this is the error that statement 5 generated.
exit status 1
no matching function for call to 'HardwareSerial::print(<unresolved overloaded function type>)'
Its the variable azDist that is causing the grief. If I change it to something else like az_move, it compiles ok. Weird.
Post code.
No line numbers.
Post actual error messages.
the variable azDist that is causing the grief
According to the otherwise useless excerpt you posted, azDist is a function, not a variable.
gcjr
May 30, 2020, 9:43pm
4
Serial.print(azDist);
if "azDist" is a function and you're trying to print it's return value, shouldn't it be
Serial.print (azDist() );
there's no print() with a function pointer argument
with 156 posts, you should know how to post code and error msgs
TheMemberFormerlyKnownAsAWOL:
Post code.
No line numbers.
Post actual error messages.
That is the actual error message and the code. I added a line number to be able to point to the statement with the error.
gcjr:
Serial.print(azDist);
if "azDist" is a function and you're trying to print it's return value, shouldn't it be
Serial.print (azDist() );
there's no print() with a function pointer argument
with 156 posts, you should know how to post code and error msgs
I resent that. This is the actual error message:
"
exit status 1
no matching function for call to 'HardwareSerial::print()'
"
I don't know what more you could want nor how I could make it any clearer, so please turn off the snarkiness.
I think that the answer is that azDist is a function and not a variable.
I think that the answer is that azDist is a function and not a variable.
I hope so. Two forum members have tried to explain that to you.
The next time you post, do not forget to post ALL the code.
jremington:
I hope so. Two forum members have tried to explain that to you.
The next time you post, do not forget to post ALL the code.
If I were to post all the code, you would yell at me. The sketch is about 450 statements and very messy.
It is not my sketch, I am jyst trying to make it work.
I actually inserted the print command as I am trying to figure out what it is doing. There are very few comments.