RobTillaart / DHTNew

Arduino library for DHT11 and DHT22 with automatic sensor recognition
MIT License
99 stars 15 forks source link

Support for DS18B20 #83

Closed simonbogh closed 2 years ago

simonbogh commented 2 years ago

Not sure if it makes sense as it is not from the DHT family, but support for DS18B20 would be great so that we can use just one library. Just a thought.

RobTillaart commented 2 years ago

The protocol is completely different. Also Ds18 does no humidity.

simonbogh commented 2 years ago

True. You can put it in a backlog or delete it 😊

RobTillaart commented 2 years ago

It is an idea already discussed on the forum long ago IIRC.

Make a base class temperature sensor T Derive all temperature only classes from T, so as they implement the base class, they have the same interface Derive a base class temp+humi sensor TH Derive all temp+humi classes from TH, so they also have similar interfaces.

problem is that for beginners this could be too complex, and it only works well if all library builders would agree. Furthermore you have really different protocols that might interfere.

It is however a great exercise for students in a computer class to redesign such sensor hierarchy.