Well, probably something really obvious here, and I haven't written C for quite a while.
This is mostly just copy/paste from the Dallas example for multi-sensor, except I modified it to store the sensor addresses in an array. I'm using the TLC 3.6.0 library from Miles Burton, and the 1-wire v.2 from pjrc.
// just messing about with DS18B20
#include <OneWire.h>
#include <DallasTemperature.h>
// Data wire is plugged into pin 2 on the Arduino
#define ONE_WIRE_BUS 2
// Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)
OneWire oneWire(ONE_WIRE_BUS);
// Pass our oneWire reference to Dallas Temperature.
DallasTemperature sensors(&oneWire);
int i; // loop counter
int numSensors; // number of 1-wire sensors
// 1-wire device addresses using type defined in Dallas header
DeviceAddress owsAddr[8];
void setup()
{
Serial.begin(9600); // setup serial
// Start up the library
sensors.begin();
numSensors = sensors.getDeviceCount();
oneWire.reset_search();
for (i = 0; i < numSensors; i++) {
if (oneWire.search(owsAddr[i])) {
Serial.print("DS18B20: ");
printAddress(owsAddr[i]);
// ^^^^^^^^^^^^ is the error line
Serial.println();
} else {
Serial.println("Something sure is goofy here!");
delay(2000);
}
}
}
Error pane
onewiretest.cpp: In function ‘void setup()’:
onewiretest:30: error: ‘printAddress’ was not declared in this scope
Assuming this function had to be defined in either the OneWire or Dallas libraries, I grepped the header and .cpp files for both of those, and found nothing. I find that interesting, but of course, it could be defined someplace else.
BTW, I know I can code something up and bitshift the address out. At the moment, I just want to label my sensors so when I actually place them, I know what's where. But it bugs me that I'm getting an error on something direct from example code. Of course, that code could be wrong (did they test it before posting?).