Open cfreeman opened 7 years ago
Doh. Sorry, still got my github training wells on. Not sure why support for the intel edison got automatically inserted into this pull request. Was aiming for a seperate pull request for that.
Pin outs for the Edison are based on this 'block' from sparkfun -- https://www.sparkfun.com/products/13038
when you open a PR it's for the delta between your branch and the base branch (such as master). Afterwards, as you add more commits to your branch these automatically go into the PR, so the PR is a "live" diff and not a diff snapshot.
I see an issue with your bme280 driver, which is that on page 21 section 4 & 4.1 of the datasheet it says "Shadowing will only work if all data registers are read in a single burst read. Therefore, the user must use burst reads if he does not synchronize data readout with the measurement cycle." So you should use a single read to read all registers into memory and then parse out the individual register values. This will also be a lot more efficient since that's only a single system call.
So the humidity, temp and pressure methods should read all of 0xF7 to 0xFE using
func (b *i2cBus) ReadFromReg(addr, reg byte, value []byte) error
That will perform a burst read?
Then assemble the uncalibrated pressure, humidity and temperature values from that []byte array?
func (s *BME280) Measurements() ([]byte, error) {
Now performs a burst read (I think?) of all the measurements, while Humidity, Pressure and Temperature can be used to calculate calibrated readings from this data.
Combined humidity, pressure and temperature sensor. Data sheet -- https://cdn-shop.adafruit.com/datasheets/BST-BME280_DS001-10.pdf