So far I've used it only for 64bit variables where this is the only way (I know of) to 'printf' them.
@mjs513: funny how complicated a simple thing like printing an 8bit variable can get :-).
...
Type: Posts; User: luni
So far I've used it only for 64bit variables where this is the only way (I know of) to 'printf' them.
@mjs513: funny how complicated a simple thing like printing an 8bit variable can get :-).
...
More tests with the PRIs
void setup()
{
while(!Serial){}
Serial.println("int64_t");
int64_t test0 = -2;
Nearly :-). You also need to add spaces:
void setup()
{
while(!Serial){}
uint32_t test = 42;
Serial.printf("Var: %08" PRIu32 "\n", test);
}
PRIxN -> x is the usual u, d, x, X etc N is the width of the variable.
E.g.
PRIu16 will print a 16bit unsigned
PRId64 will print a 64bit signed
PRIX32 will print a 32bit hex number with...
Tested with the code below. Works as expected.
#include "EEPROM.h"
struct GoodType // this is bytewise copyable
{
const char* text = "Good struct";
float version = 1.54f;
Great, the EncoderTool which depends on a current Bounce2 now compiles out of the box. Thanks