This seems like such a trivial problem, but this code doesn’t work:
if (s.Debug) { Serial.printlnf(“Starting UDP on Port %s .”, String(s.UDPPort, DEC); }
The output is:
//In the class declaration for “s”…
int UDPPort = 8023;
The “s” variable is a class. The s.Debug is a bool and works fine because the console shows the output. The s.UDPPort is an int that contains a default value upon initialization of 8023. I’ve tried different variations of the string such as creating a string variable, setting it to String() like above… but nothing has worked. I have a few places where this is happening in the printlnf functions. I resolve the one where I’m outputting a time by using:
if (s.Debug) { Serial.printlnf("DSBcmd message received at %s: ", Time.timeStr().c_str()); }
Any ideas how to fix? Is this a syntax problem?