setting a bit
TC
Posts: 1,019
Hello all, I have been trying to find an easy way of setting one bit of a variable.
For example:
to read; Bit 15 = 0. To write, bit 15 = 1.
Thanks for your help
For example:
to read; Bit 15 = 0. To write, bit 15 = 1.
Thanks for your help
Comments
variable &= ! |< bitNumber ' this clears a bit
There are longer solutions when you want to change several bits, but these are the most compact single bit methods.
Thank You
Thank You