Hi all, Is it possible to print bit types using:
bit bitvalue; bitvalue = funcReturningBitType(); sprintf(g_SIOString, "bit = %u\n", bitvalue); String_to_serial_port(g_SIOString);
'u' is a conversion specifier for 'unsigned', so to be precise:
sprintf(g_SIOString, "bit = %u\n", (unsigned)bitvalue);
sprintf(g_SIOString, "bit = %u\n", (bitvalue ? 1U : 0U));
Thanks Dan! I thought the bit would be converted automatically, just like u8's etc will automatically be converted to u16's etc. I'll give this a try. Regards, Joost Leeuwesteijn