DS18B20 Adress

Hi guys,

I have a DS18B20 sensor, and in my program I have the sensor's adress. I want to use this as an advantage.

How can I write when the given adress doesn't match (cause there is only one same adress) ie the sensor is off the board, terminate the whole program.

I have something like this:

DeviceAddress insideThermometer = { 0x28, 0xA0, 0xD7, 0x1A, 0x05, 0x00, 0x00, 0x5B };

So I don't know how to say like if the adress in the { ... } is not the same with the one on the board, terminate the program, shut the LCD etc.?

Thanks in advance!

At first try to find all one wire bus devices, compare found “mac” addresses with the desired one and according to decide how to continue the program…

I attach my experimental program for DS18B20 (reads and shows all sensors).

Mega2560_3x_DS18B20_3x_LED_v006.ino (2.87 KB)