HELP! Having crazy problem with serial Transmission.

When you use the keyboard to send data it sends ASCII characters, not the actual number on the key.

Instead of comparing the character to 0x01 and 0x00, compare it to '1' and '0' in single quotes.