Enhanced RATempSensor Class
Posted: Mon Aug 20, 2018 7:24 am
Hi,
I have attached code for an enhanced RATempSensor class. It should be fully compatible with all existing code but it includes an additional function, RemapSensors.
I added this function because when I changed some of my temperature probes, they came out in a different order than I wanted them to and since some had long cords and others had short cords I couldn't just rearrange them. RemapSensors changes which physical probe is T1, T2, T3 and so forth.
To use it, call it right after ReefAngel.Init().
As an example:
The array determines where the sensors will be mapped to. So the number in the first position of the array tells us which sensor will be T1. The second position tells us which sensor will be T2, and so forth. So in the example above, the sensor that would previously have been T3 is now T1 (the array is zero based).
For some examples
{0, 0, 0} will cause T1, T2, and T3 to all read the probe that would previously have been T1.
{0, 1, 2} leaves everything alone, but if you want to do that, just don't make the call.
The array can include 6 numbers if you have the extra sensors defined in the code.
So the example
I have attached code for an enhanced RATempSensor class. It should be fully compatible with all existing code but it includes an additional function, RemapSensors.
I added this function because when I changed some of my temperature probes, they came out in a different order than I wanted them to and since some had long cords and others had short cords I couldn't just rearrange them. RemapSensors changes which physical probe is T1, T2, T3 and so forth.
To use it, call it right after ReefAngel.Init().
As an example:
Code: Select all
byte sensorMap[3] = {2, 0, 1};
ReefAngel.TempSensor.RemapSensors(sensorMap);
For some examples
{0, 0, 0} will cause T1, T2, and T3 to all read the probe that would previously have been T1.
{0, 1, 2} leaves everything alone, but if you want to do that, just don't make the call.
The array can include 6 numbers if you have the extra sensors defined in the code.
So the example