MCPcopy Create free account
hub / github.com/LowPowerLab/RFM69 / readTemperature

Method readTemperature

RFM69.cpp:967–972  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

965}
966
967uint8_t RFM69::readTemperature(uint8_t calFactor) { // returns centigrade
968 setMode(RF69_MODE_STANDBY);
969 writeReg(REG_TEMP1, RF_TEMP1_MEAS_START);
970 while ((readReg(REG_TEMP1) & RF_TEMP1_MEAS_RUNNING));
971 return ~readReg(REG_TEMP2) + COURSE_TEMP_COEF + calFactor; // 'complement' corrects the slope, rising temp = rising val
972} // COURSE_TEMP_COEF puts reading in the ballpark, user can add additional correction
973
974void RFM69::rcCalibration() {
975 writeReg(REG_OSC1, RF_OSC1_RCCAL_START);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected