To set bit 4 on and leave the rest unchanged:
mybyte=mybyte | %00010000 'OR function with selected bit masked ON
To turn bit 4 off and leave the rest unchanged:
mybyte=mybyte & %11101111 'AND function with selected bit masked OFF
OR you can set multiple bits on or off by either ADDING or SUBTRACTING the bit weight to/from either 0 or 255 respectively.
------------------Picster-----------------
Bookmarks