比如我想设定下限零下25度报警,-25C
如何设定呢?下面的函数是正确的
void Config18b20 (void) //重新配置报警限定值和分辨率
{ Init18b20(); WriteByte(0xcc); //skip rom WriteByte(0x4e); //write scratchpad WriteByte(0x19); //上限 WriteByte(0x1a); //下限 WriteByte(0x7f); //set 11 bit (0.125) Init18b20(); WriteByte(0xcc); //skip rom WriteByte(0x48); //保存设定值 Init18b20(); WriteByte(0xcc); //skip rom WriteByte(0xb8); //回调设定值 } |