Hi all,
I’m trying to write a simple wrapper around ‘Serial.print’ so I can easily disable all my output messages in one go. I was also creating something a bit more powerful that would allow for multiple arguments.
I created this:
#define DEBUG_LOG(msg, ...) MsgOutImpl(msg, ##__VA_ARGS__)
void MsgOutImpl(const char* msg, ...)
{
char buff[256];
va_list argptr;
va_start(argptr, msg);
vsnprintf(buff, 256, msg, argptr);
Serial.println(buff);
}
Now, it seems to work fine for most things, however I was trying to print out float values and the output is a ‘?’.
So doing DEBUG_LOG("%f", 12.0f) will print ‘?’.
Target platform is: nanoatmega328new
Any ideas what may be going on here?
Thanks!