Hello.
I have a problem with connecting 2 independent DS18B20 probes.
The whole thing is on the plugs and the LCD.
When there are two, it's ok, when I unplug one, the top one remains on the LCD, when I unplug the second one and plug in the first one, the top one also remains on the LCD.
So I can swap sensors and the LCD will show the opposite.
Is there an option to connect them separately, each in a different port and how to define this in the code?
#define D1 5
#define D2 4
#define D3 0
OneWire oneWire(0);
DallasTemperature sensors(&oneWire);
void loop() {
sensors.requestTemperatures();
float TEMP1 = sensors.getTempCByIndex(0);
float TEMP2 = sensors.getTempCByIndex(1);
Thank you for your help
I have a problem with connecting 2 independent DS18B20 probes.
The whole thing is on the plugs and the LCD.
When there are two, it's ok, when I unplug one, the top one remains on the LCD, when I unplug the second one and plug in the first one, the top one also remains on the LCD.
So I can swap sensors and the LCD will show the opposite.
Is there an option to connect them separately, each in a different port and how to define this in the code?
#define D1 5
#define D2 4
#define D3 0
OneWire oneWire(0);
DallasTemperature sensors(&oneWire);
void loop() {
sensors.requestTemperatures();
float TEMP1 = sensors.getTempCByIndex(0);
float TEMP2 = sensors.getTempCByIndex(1);
Thank you for your help