in the scan function, I declare an object at line 98. But that doent work?!
I can use the same ds for each pin???
Additionaly, when I read the value, I do the same at line 163 .
Are you agree, it's wrong?
I discovered that issue because for another application, I have the DS18B20 sensor connected to A5, then my library does notwork for a 5th sensors.
Then I need to rethink to be able to have (and use) 4 DS18B20 on the same board and to be free to have anther DS18B20 sensors connected to another pin, as it's the case for my second application. How would you modify the constructor?
Or may be I should define the pin mode in the ino file and not in the library.
In my first application, I need 4 DS18B20 (which could be on the same bus). BUT I also want to use the same board for another application which does not need DS18B20 sensors, but need the analog pin for another purpose. That the reason why I did not want to have the analog pin of the connectors linked.
But now my worries is about my library and the fact to have serveral OneWire ds(readPin); which does not sound good, in my point of view, but I am not sure...
The Arduino-Temperature-Control-Library is quite capable of handling multiple sensors per OneWire bus and multiple OneWire bus instances. So, unless you're doing this as a learning exercise, you're likely reinventing something that has already been invented.