-1

我想屏蔽我的 6 位信号以传递 20 摄氏度的值

4

1 回答 1

0

尝试这个

int firstvalue = 0xFF;
int secondValue = 0x55;
int result = 0;

result = firstvalue & 0xAA;
write("0xFF & 0xAA = %X", result);

result = secondValue & 0xAA;
write("0x55 & 0xAA %X", result);

result = secondValue & 0x01;
write("0x55 & 0x01 %X", result);

result = secondValue & 0;
write("0x55 & 0 %X", result);

result = firstvalue & 0x01;
write("0xFF & 0x01 %X", result);
于 2018-07-03T12:24:37.403 回答