while (1);
}
- char buf[8];
+ char buf[32];
while (1) {
lcdClear();
int16_t temp = tempGetDieTemperature();
- sprintf(buf, "%04d", temp);
+ int16_t vobj = tempGetObjVoltage();
+ sprintf(buf, "T: %4d V: %4d", temp, vobj);
lcdPuts(buf);
delay(1000);
}
return (raw >> 2) / 32;
}
+int16_t tempGetObjVoltage(void)
+{
+ return tempI2CRead(TMP006_VOBJ);
+}
+
void tempI2CWrite(uint8_t reg, uint16_t value)
{
uint8_t data[3] = {
*/
int tempInit(void);
+/**
+ * Gets the object's voltage, which may be used in calculations to get the
+ * object's temperature.
+ * @return The object's voltage
+ */
+int16_t tempGetObjVoltage(void);
+
+/**
+ * Gets the current ambient temperature, in Celsius.
+ * @return The ambient temperature
+ */
int16_t tempGetDieTemperature(void);
#endif // TEMP_H_