Enhanced RATempSensor Class

Related to the development libraries, released by Curt Binder

Posts: 140
Joined: Tue Oct 04, 2011 5:49 am
PostPosted: 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:

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 17 times
RA_TempSensor.cpp
(3.3 KiB) Downloaded 17 times
Last edited by dedvalson on Wed Aug 22, 2018 3:10 am, edited 1 time in total.
User avatar
Posts: 2749
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
PostPosted: Mon Aug 20, 2018 8:32 am
very interesting. pretty neat idea and should be helpful for people.


Sent from my iPad using Tapatalk

Posts: 12327
Joined: Fri Mar 18, 2011 6:47 pm
PostPosted: Mon Aug 20, 2018 9:37 am
Awesome!!
I'll check it out l
Roberto.

Posts: 12327
Joined: Fri Mar 18, 2011 6:47 pm
PostPosted: Fri Nov 23, 2018 11:00 pm
It is in the dev branch as well as in the webwizard.
Roberto.

Return to Development Libraries

Who is online

Users browsing this forum: No registered users and 2 guests