What is the simplest way to get or set single bits in a byte?
Ok, maybe this shouldn't be under questions but.... I'm used to use the following (MCU programming)
Ex:
Dim bit0, bit1 as boolean
Dim byte as byte
bit0 = byte.0 'Get bit 0 in byte
byte.1 = bit1 'Set bit 1 in byte
Dim bit0, bit1, bit2 as boolean
Dim mybyte as byte
bit0 = Bit.And(mybyte, 1) 'Get bit 0 in byte
bit1 = Bit.And(mybyte, 2) 'Get bit 1 in byte
bit2 = Bit.And(mybyte, 4) 'Get bit 2 in byte
.... and so on