Notes from verifying and testing the integration time changes and temperature calculations.
Used a spreadsheet to visualize the valid temperatures at each integration time setting.
For example, the gray rows/blue text in the sheets are valid temps expected at each integration time. ie. when integration time is 0.5, the 3 LSB's are always zero, so I should never see temps with data in those 3 LSB's.
To verify that the integration time was indeed changing, I initially added a read register in the driver code that verified the resolution register was written correctly. Then, to verify that the driver (& sensor) was behaving correctly and actually reporting temps in the new integration times, I used some bash scripts like this:
If I don't sleep after changing integration time, the first temp reading may be illogical.
Note below that raw:318 is an invalid reading when integration time is 0.5
If I sleep in the script, I get the nice expected output shown below:
We don't want to depend on the application sleeping, so I'll add a little sleep time to the mcp9808 driver next.
Labels: Build-a-Driver, MCP9808