我想屏蔽我的6位信号以传递20摄氏度的值
答案 0 :(得分: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);