it's quite simple. but when i run it on an Arduino UNO, the led never goes off. in the serial monitor, i do see that arduino write back '1' or '2' or anything sent to it. but it just cannot go into the if() statement. really weird!
really really weird! I just find that if the binary format of the ASCII of the character contains even number of '1', it works. otherwise it cannot go into the if() statement.
e.g. if(inChar = '0') or if(inChar = '3') or if(inChar = 'P'), it can go into the if() statement.
'0': 00110000
'3': 00110011
'P': 01010000
and for other characters, it cannot work. such as:
'1': 00110001
'R': 01010010