Page 1 of 1

Suggested minor change for libraries.

Posted: Tue Nov 29, 2011 9:55 am
by dedvalson
I have noticed that a lot of customers have trouble getting the bit masks correct for things like the WaterChangePorts.

Why not add the following block of code to the ReefAngel_Globals.h file

Code: Select all

#define Port8Bit 0x80
#define Port7Bit 0x40
#define Port6Bit 0x20
#define Port5Bit 0x10
#define Port4Bit 0x08
#define Port3Bit 0x04
#define Port2Bit 0x02
#define Port1Bit 0x01
Then people could do

Code: Select all

ReefAngel.WaterChangePorts = Port8Bit | Port4Bit | Port5Bit;
instead of

Code: Select all

ReefAngel.WaterChangePorts = B10011000;

Re: Suggested minor change for libraries.

Posted: Tue Nov 29, 2011 10:07 am
by rimai
That's awesome!!!
I love that.
Sometimes the solution is right in front of you, but in your lifetime you would never see it.
Then another person comes along and tells you: "Hey, just do this."
It's like a lightbulb turned on and all seems bright and clear after that.
This is one of those moments for me. It's brilliant :ugeek:
So much easier.

Re: Suggested minor change for libraries.

Posted: Tue Nov 29, 2011 11:24 am
by wolfador
rimai wrote:That's awesome!!!
I love that.
Sometimes the solution is right in front of you, but in your lifetime you would never see it.
Then another person comes along and tells you: "Hey, just do this."
It's like a lightbulb turned on and all seems bright and clear after that.
This is one of those moments for me. It's brilliant :ugeek:
So much easier.

lol one of the many wonders of software development. That is why open source works so much better.