I have twenty 1wire temp sensors. Each has a unique 8 byte address. In the sample 1wire sketch, the address is stored in a typedef called DeviceAddress which is defined as in the libarary as : typedef uint8_t DeviceAddress[8];
I'd like to do something like this:
DeviceAddress tempSensorAddresses[20];
tempSensorAddresses[0] = { 0x10, 0xD0, 0x8E, 0x6A, 0x02, 0x08, 0x00, 0xE4 };
tempSensorAddresses[1] = { 0x10, 0xD0, 0x8E, 0x6A, 0x02, 0x08, 0x00, 0xE5 };
tempSensorAddresses[2] = { 0x10, 0xD0, 0x8E, 0x6A, 0x02, 0x08, 0x00, 0xE6 };
and so on for all 20 sensors
But this doesn't work. I know I have an array of arrays, so maybe this doesn't make sense to do it this way. I'd appreciate any suggestions in how I can do this. When I read the sensors I want to do it in a loop; so looping through an array would be ideal instead if 20 lines of code to read each one.
While I'm on the subject of arrays, why doesn't this work:
byte myArray[8];
myArray = { 0x10, 0xD0, 0x8E, 0x6A, 0x02, 0x08, 0x00, 0xE4 };
But this does
byte myArray[8] = { 0x10, 0xD0, 0x8E, 0x6A, 0x02, 0x08, 0x00, 0xE4 };