Skip to content

Instantly share code, notes, and snippets.

@willprice
Created November 24, 2013 12:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save willprice/7626592 to your computer and use it in GitHub Desktop.
Save willprice/7626592 to your computer and use it in GitHub Desktop.
Print out the bits of a 'uint8_t' for debugging
void print_uint8_t(uint8_t n) {
int i;
for (i = BITSOF(n); i >= 0; i--)
printf("%d", (n & (1<<i)) >> i);
putchar('\n');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment