HDC1080 Humidity and Temperature Sensor Module Test Program Design Notes
Now that I have studied the HDC1080 datasheet, I can start coding. But before that I need to do a selfie walk through of the python modules I have coded so far, to refresh my memory, and also thinking how to glue them together.
Old Modules Selfie Walkthrough
1. So far I have debugged 3 modules: i2cutil01.py, rtc01.py, iox01.py, and
now starting the new module, hts01.py.
2. i2cutil01.py
I started rtc01 testing the following RTC DS3231 functions:
Code: Select all
'0' 'Write and read back Day Register
'1' 'Repeat write 0x5a to Rtc Day Register (for scope)
'2' 'Read and print temperature once
'3' 'Read and print temperature four times
'x' 'Exit
3. rtc01.py
Then I wrote a new rtc01.py, which imports i2cutil01.py and has it own high level register read write functions which call i2cuitl01's low level slave register read write functions. This way, the ugly smbus functions are abstracted away. Module i2cutil01 is a Minimal, Complete, Verifiable, NoProblem Example. But this new rtc01 neess i2cutil01. In other words, only two modules together are then 'minimal'. This new rtc01 module has a fuller set of rtc functions, including real time and interrupt, as listed below:
Code: Select all
'0' Write read Day register
'1' Read temperature
'2' Read dateTime
'3' Test Square Wave output
'4' Test Interrupt output
'5' I2cUtil Write read Day register
'6' I2cUtil Read temperature
'7' I2cutil test
'x' I2cutil exit
/ to continue, ...