I would appreciate any review comments or suggestions. It's smaller than the original code (That's the most important part, right? ) I was tempted to just import one of several DS18B20 libraries that exist for Arduino as it appears there are some subtleties and DS bugs that we might want to avoid.
Assuming this goes well, I will likely keep marching on with refactoring the rest of the temperature handling code within ReefAngel to use only Celsius units internally and have Fahrenheit units only as a display preference. To see units associated with a variable vary at runtime makes my skin crawl!
I was briefly looking at the commit and saw that you resized the array to size 3.
The reason we had at 4 was to make it simpler to code, should you wanted to use numerical instead of defined variables.
For example:
ReefAngel.Params.Temp[1] would be the same as ReefAngel.Params.Temp[T1_PROBE]
The trade off is an empty spot in the array, which is the 0 index.
What do you think?
I changed the definitions for T1_PROBE, etc. as well. I guess zero based counting doesn't bother me. I don't feel strongly about this though. If you would prefer T1_PROBE to be 1 and the ReefAngel.Params.Temp to have an unused slot for the sake of clarity then I am fine with that.
We like simple. Thx to all that program this wonderful product for those of us that copy, cut, and paste.
Roscoe's Reefs - Starting Over Again:
Building new 29g Nano after landlord went berserk over my 4 75 gallon tanks, Multiple RA's, Water mixing stations, etc. Your help welcomed in remembering all I've forgotten.
Hey Mike,
Did you read the comment I left on the pull request?
It is not working for me here and it also made my code larger by about 600 bytes and not smaller.