Hello,
I'm pretty new to the coding-language C++. I want to use mutliple onewire temperature-sensors.
Each onewire-device (short 1W-device) has a globally unique ROM-ID which is 8 byte long. This ROM-ID is received as 8 bytes and stored in an array of bytes.
byte addr[8];
In a setup-process I will readout each ROM-ID which is connected to the 1W-bus.
And assign each ROM-ID to a certain variable.
SensorROM_ID_bath, SensorROM_ID_kitchen etc.
Then I want to use these variables SensorROM_ID_bath, SensorROM_ID_kitchen to readout the temperatures
bathTemp = readTemp(SensorROM_ID_bath);
kitchenTemp = readTemp(SensorROM_ID_kitchen);
Now I'm looking for an efficient how to realise this.
Is it possible to compare two arrays as whole arrays?
in a codeline like shown below?
byte addr[8];
byte SensorROM_ID_bath[8];
if addr == SensorROM_ID_bath
// do the bath-things
if addr == SensorROM_ID_kitchen
// do the kitchen-things
as a general question:
before posting this question here I tried a lot of searches with different keywords.
Google will always find something but not very relevant things.
It is easy to post new questions here. I guess similar questions have been posted a dozen times.
But it seems to be hard to find the relevant postings.
Do you happen to know how to do a search in that way that relevant hits have a high probability?
best regards
Stefan