Strange
unsigned char QTXControl is a number from 0 to 10
if (QTXControl != 0) works
if (!QTXControl) does not
Is the shortcut only for boolean?
! is a logical operator. You could write your working expression as either:
Code:
if (QTXControl != 0)
// Or (this one sometimes preferred stylistically)
if (QTXControl)
// Or
if (!(QTXControl == 0))
The equivalent for your second statement would be:
Code:
if (!QTXControl)
// Or
if (QTXControl == 0)
So we can see they are opposites of eachother.