Also what does this do
if ( 2048 & value_b )
Does it just say if value_b = 2048 then do whats in the curly braces?
No. It means that is the 11th bit of value_b is a 1, do the rest of the statement.
1 = Bit 0 = 0b0000000000000001
2 = Bit 1 = 0b0000000000000010
4 = Bit 2 = 0b0000000000000100
8 = Bit 3 = 0b0000000000001000
16 = Bit 4 = 0b0000000000010000
32 = Bit 5 = 0b0000000000100000
64 = Bit 6 = 0b0000000001000000
128 = Bit 7 = 0b0000000010000000
256 = Bit 8 = 0b0000000100000000
512 = Bit 9 = 0b0000001000000000
1024 = Bit 10 = 0b0000010000000000
2018 = Bit 11 = 0b0000100000000000