Im writing a VB.NET app that reads in bytes. I have a short which contains 2 Bytes received from an outside source. I now need to get "Bit 8" from the high byte, i cant work out how to do this i can get "bit 1" back as true to tell me if the source is switched on but cant get "bit 8" which i assume is in the second byte.
i've tried
Dim bit8 = (p_Value And (1 >> 512 - 1)) <> 0
this works for bit 1
Dim bit1 = (p_Value And (1 << 1 - 1)) <> 0
Document of device gives me
low byte
bit 0
through to
bit7
High byte
bit 8 *the one i want
through to
bit 15
I've searched but everything seems to be for single bytes.
Phil