Hi
I am trying to read multiple ds18b20 temperature sensors with the SC and I am using a basic program that worked for me on the arduino. The sketch keeps hanging on the print address function. The error reads; ‘DeviceAddress’ was not declared in this scope
I know the answer has got to be simple but has eluded me so far. The code is below.
Thanks
#include "spark-dallas-temperature/spark-dallas-temperature.h"
#include "OneWire/OneWire.h"
#define ONE_WIRE_BUS 2
#define TEMPERATURE_PRECISION 9
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);
DeviceAddress insideThermometer = {0x28, 0xD4, 0xFA, 0xB3, 0x5, 0x0, 0x0, 0x31};
DeviceAddress outsideThermometer = {0x28, 0x2A, 0x63, 0x50, 0x5, 0x0, 0x0, 0xD5};
void printAddress(DeviceAddress deviceAddress)
{
for (uint8_t i = 0; i < 8; i++)
{
// zero pad the address if necessary
if (deviceAddress[i] < 16) Serial.print("0");
Serial.print(deviceAddress[i], HEX);
}
}
– added formatting (@mdma)