SparkFun Temperature Sensor AS6212 set high low thresholds

SparkFun Digital Temperature Sensor Breakout - AS6212 (Qwiic) SEN-18521

was testing this sensor using example 5 alert, and noticed when I specify the high and low thresholds the get functions return a slightly different value, examples:

sensor.setTHighF(80); // set high threshhold ALERT ACTIVE alertstatus = 0

sensor.setTLowF(70); // set low threshhold at 78 ALERT ACTIVE LOW cleared alertstatus = 1

Serial.print("\tThighF: “); Serial.print(sensor.getTHighF(), 2); Serial.print(”\tTlowF: "); Serial.println(sensor.getTLowF(), 2);

// ThighF: 78.80 TlowF: 69.80

sensor.setTHighF(75); // set high threshhold ALERT ACTIVE alertstatus = 0

sensor.setTLowF(70); // set low threshhold at 78 ALERT ACTIVE LOW cleared alertstatus = 1

Serial.print("\tThighF: “); Serial.print(sensor.getTHighF(), 2); Serial.print(”\tTlowF: "); Serial.println(sensor.getTLowF(), 2);

// ThighF: 73.40 TlowF: 69.80

sensor.setTHighF(70); // set high threshhold ALERT ACTIVE alertstatus = 0

sensor.setTLowF(65); // set low threshhold at 78 ALERT ACTIVE LOW cleared alertstatus = 1

Serial.print("\tThighF: “); Serial.print(sensor.getTHighF(), 2); Serial.print(”\tTlowF: "); Serial.println(sensor.getTLowF(), 2);

// ThighF: 69.80 TlowF: 64.40

sensor.setTHighF(70); // set high threshhold ALERT ACTIVE alertstatus = 0

sensor.setTLowF(64.4); // set low threshhold at 78 ALERT ACTIVE LOW cleared alertstatus = 1

Serial.print("\tThighF: “); Serial.print(sensor.getTHighF(), 2); Serial.print(”\tTlowF: "); Serial.println(sensor.getTLowF(), 2);

//ThighF: 69.80 TlowF: 62.60

thanks

That appears to be due to how the registers that control the readings are arranged - check out this blurb here https://learn.sparkfun.com/tutorials/di … leshooting and 6.2.9 of the datasheet for more info on how to control them

Thanks !