I'm trying to compare the first number of a byte, instead of checking the whole byte to reduce code.
The situation is as follow:
I'm comparing an incoming message (byte array) to another byte array.
I need to know if the first number in the 4th byte is a 2. It doesn't matter wat the next number in that byte is.
Usually the byte will be 0x20, 0x21, 0x22 or 0x23
Is there a cleaner way to check this, rather than:
I've been thinking I could also just work with it as a decimal, since the value would then always be between 32 and 35, but I just wanted to know if it's possible to 'extract' the first part of the byte.