Apollon77 / I2CSoilMoistureSensor

Simple Arduino Library for the I2C Soil Moisture Sensor version from Chirp (https://github.com/Miceuz/i2c-moisture-sensor)
MIT License
73 stars 27 forks source link

A Wire.requestFrom() should not be followed by a Wire.endTransmission(). #15

Closed Koepel closed 5 years ago

Koepel commented 6 years ago

In the function "readI2CRegister16bitUnsigned()", there is a Wire.endTransmission() after the Wire.requestFrom(). You can remove that second Wire.endTransmission() in that function.

The Wire.endTransmission should only be used when writing data.

Apollon77 commented 6 years ago

Do you have tested the functionality when you change this? I do not have the sensors in use anymore, that's why I need you to test it (or someone else)

Koepel commented 6 years ago

No, sorry. I was tired of explaining in forums how to use the Wire library. That's why I started to make many issues on Github, trying to tilt it into the right way. The extra Wire.endTransmission() is not harmless: Common-mistakes#2