Page 1 of 1

Enhanced RATempSensor Class

PostPosted: Mon Aug 20, 2018 7:24 am
by dedvalson
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:

Code: Select all
byte sensorMap[3] = {2, 0, 1};
ReefAngel.TempSensor.RemapSensors(sensorMap);


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

Re: Enhanced RATempSensor Class

PostPosted: Mon Aug 20, 2018 8:32 am
by binder
very interesting. pretty neat idea and should be helpful for people.


Sent from my iPad using Tapatalk

Re: Enhanced RATempSensor Class

PostPosted: Mon Aug 20, 2018 9:37 am
by rimai
Awesome!!
I'll check it out l

Re: Enhanced RATempSensor Class

PostPosted: Fri Nov 23, 2018 11:00 pm
by rimai
It is in the dev branch as well as in the webwizard.