Printing binary

How do I get the Serial.print(myByte, BIN); statement to print out the whole byte and not truncate the leading zeros if they are part of the byte?

I need a list of all eight digits in the byte that prints including zero in the MSB end.

How do I get the Serial.print(myByte, BIN); statement to print out the whole byte and not truncate the leading zeros if they are part of the byte?

You can't unless you modify the underlying Serial class.

I need a list of all eight digits in the byte that prints including zero in the MSB end.

void printBinary(byte inByte)
{
  for (int b = 7; b >= 0; b--)
  {
    Serial.print(bitRead(inByte, b));
  }
}

Please don't hijack unrelated threads.
Topic split

There is NO difference between 10 and 00000010. If you want to see 00000010 as the output, you have two choices - use bitRead() and output the result, in a loop over all the bits of the byte, OR use sprintf() to populate a string with leading 0s and print the string.

Thanks for the help. I had concluded the same as the above comments. I just was disappointed that there wasn't a direct way to do this simple task. Most programmers don't deal with machine code and working with logic gates, but when you do, partial byte read-outs are really frustrating. Truncation is great for financial transactions, but not when recording byte streams for analysis.

runcation is great for financial transactions, but not when recording byte streams for analysis.

Why not print in Hex ? It is often easier to read and interpret than binary and does not involve counting ones and zeroes.