The oldest, tried-and-true debugging technique in embedded development is to sprinkle printf statements throughout the software in the hope of gleaning insight into system behavior. Using printf is ...
When you have a width specification of 1 (like you do in the second line) the output will be H or T. If you have anything else, the output will be HEADS or TAILS. But first, we need to add the %H ...