Bit-level operations – bit flags and bit masks
This article introduces to bit flags, bit masks and basic bit-level operations on them. In the world of microcontrollers, when you need to save a boolean values (true/false) then it can be useful to “pack” individual boolean values into a single integer value for storage efficiency purposes. This is done by using the bitwise and shift operators to set, clear, … Read more