Hi, now this should all work as fars as I can tell but all five sensor values are coming out with the same value - ie that of S1..... any idea what daft mistake I have made?
#include <OneWire.h>
#include <DallasTemperature.h>
float S1;
float S2;
float S3;
float S4;
float S5;
#define ONE_WIRE_BUS 7
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);
DeviceAddress Sensor1 = { 0x28, 0x64, 0xDB, 0x8B, 0x03, 0x00, 0x00, 0x86 };
DeviceAddress Sensor2 = { 0x28, 0x0C, 0x06, 0x8C, 0x03, 0x00, 0x00, 0xD0 };
DeviceAddress Sensor3 = { 0x28, 0xCA, 0xD9, 0x8B, 0x03, 0x00, 0x00, 0x4A };
DeviceAddress Sensor4 = { 0x28, 0xB6, 0x02, 0x8C, 0x03, 0x00, 0x00, 0x07 };
DeviceAddress Sensor5 = { 0x28, 0x11, 0xDA, 0x8B, 0x03, 0x00, 0x00, 0x38 };
void setup ()
{
sensors.begin();
if (!sensors.getAddress(Sensor1, 0)) error();
if (!sensors.getAddress(Sensor2, 0)) error();
if (!sensors.getAddress(Sensor3, 0)) error();
if (!sensors.getAddress(Sensor4, 0)) error();
if (!sensors.getAddress(Sensor5, 0)) error();
sensors.setResolution(Sensor1, 12); // set the resolution
sensors.setResolution(Sensor2, 12); // set the resolution
sensors.setResolution(Sensor3, 12); // set the resolution
sensors.setResolution(Sensor4, 12); // set the resolution
sensors.setResolution(Sensor5, 12); // set the resolution
void loop ()
{
sensors.requestTemperatures();
S1 = sensors.getTempC(Sensor1);
S2 = sensors.getTempC(Sensor2);
S3 = sensors.getTempC(Sensor3);
S4 = sensors.getTempC(Sensor4);
S5 = sensors.getTempC(Sensor5);
}