Enhanced RATempSensor Class

Related to the development libraries, released by Curt Binder
Post Reply
dedvalson
Posts: 140
Joined: Tue Oct 04, 2011 5:49 am

Enhanced RATempSensor Class

Post 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
Attachments
RA_TempSensor.h
(1.33 KiB) Downloaded 530 times
RA_TempSensor.cpp
(3.3 KiB) Downloaded 539 times
Last edited by dedvalson on Wed Aug 22, 2018 3:10 am, edited 1 time in total.
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Enhanced RATempSensor Class

Post by binder »

very interesting. pretty neat idea and should be helpful for people.


Sent from my iPad using Tapatalk
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Enhanced RATempSensor Class

Post by rimai »

Awesome!!
I'll check it out l
Roberto.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Enhanced RATempSensor Class

Post by rimai »

It is in the dev branch as well as in the webwizard.
Roberto.
Post Reply