Programming: If Condition Testing a Variable Against a Binary Number

Sometimes a condition will need to exist that tests a variable against a binary number. This is how to do this using the == operator.



Example: if (receiveData == 0b11110000) PORTB ^= (1 << PINB0);
Back to blog

Leave a comment

Please note, comments need to be approved before they are published.