const byte ambientSensorAddr[8] = {0x28, 0x61, 0x24, 0xC5, 0x03, 0x00, 0x00, 0x51};
const byte fridge1WortSensorAddr[8] = {0x28, 0x61, 0x24, 0xC5, 0x03, 0x00, 0x00, 0x51};
const byte fridge1AirSensorAddr[8] = {0x28, 0x61, 0x24, 0xC5, 0x03, 0x00, 0x00, 0x51};
const byte fridge2WortSensorAddr[8] = {0x28, 0x61, 0x24, 0xC5, 0x03, 0x00, 0x00, 0x51};
const byte fridge2AirSensorAddr[8] = {0x28, 0x61, 0x24, 0xC5, 0x03, 0x00, 0x00, 0x51};
// setup() and loop() here.
int getSensorTemp(int fermVess, int sensorNumber) {
// Define the variable for the sensor address here.
byte sensorAddr;
Serial.print("Getting sensor temp:");
switch(fermVess) {
case 0:
// Only one sensor for this one and that's the
// Ambient sensor. We ignore the value of sensorNumber.
sensorAddr[] = ambientSensorAddr;
break;
case 1:
// Fermentation Vessel 1.
switch(sensorNumber) {
case 0:
// Wort Sensor.
sensorAddr[] = fridge1WortSensorAddr;
break;
case 1:
// Fridge Air Temp Sensor.
sensorAddr[] = fridge1AirSensorAddr;
break;
}
break;
// Fermentation Vessel 2.
case 2:
switch(sensorNumber) {
case 0:
// Wort Sensor.
sensorAddr[] = fridge2WortSensorAddr;
break;
case 1:
// Fridge Air Temp Sensor.
sensorAddr[] = fridge2AirSensorAddr;
break;
}
break;
}
// code to read the actual sensor is here.
}