Line: 1 to 1 | |||||||||
---|---|---|---|---|---|---|---|---|---|
Solutions to Exercise 4: The I2C Bus and the SHT30 Temperature and Humidity SensorExercise 2: | |||||||||
Changed: | |||||||||
< < | This is an extremely relevant exercise because it shows typical work that must be done during an IoT project. Often code from other authors can be found on the Internet (e.g. github) but often you find problems with this. Maybe it is | ||||||||
> > | This is an extremely relevant exercise because it shows typical work that must be done during an IoT project. Often code from other authors can be found on the Internet (e.g. github) but often you find problems with this. Maybe it is | ||||||||
| |||||||||
Line: 44 to 44 | |||||||||
Let's try to send a reset command with a little script, not using the sht30 driver: | |||||||||
Changed: | |||||||||
< < | |||||||||
> > | |||||||||
with this result: | |||||||||
Changed: | |||||||||
< < | |||||||||
> > | |||||||||
This tells me that start() and stop() are not supported by the I2C driver on the ESP32. Looks like the I2C start and stop conditions have been integrated into the writeto() and readfrom() methods! Let's just remove those two calls: | |||||||||
Line: 56 to 56 | |||||||||
As you can see, the reset now works without errors. And since we are at it, let's try to make a measurement without passing through the SHT30 class: | |||||||||
Changed: | |||||||||
< < | |||||||||
> > | |||||||||
with this result: | |||||||||
Changed: | |||||||||
< < | Now that we know how to read and write the SHT30 using the ESP32 I2C driver, we can make the necessary corrections in the SHT30 class. | ||||||||
> > | Now that we know how to read and write the SHT30 using the ESP32 I2C driver, we can make the necessary corrections in the SHT30 class. After the change all the code snippets in the README.md file should work.
Improving the SHT30 class | ||||||||
-- Uli Raich - 2020-05-18 | |||||||||
Line: 77 to 78 | |||||||||
| |||||||||
Deleted: | |||||||||
< < |
| ||||||||
| |||||||||
Added: | |||||||||
> > |
|