m12lrpv:
m12lrpv:
I can see that there is a setBacklightPin method but i'm not sure that it covers all the options.
I was being polite and wasn't actually doubtful.Look at how it's used.
The library backlight off mask is 0x00. You cannot "&" a pin value to that to get a backlight off mask of 0x80 for the hardware that needs it.
Better to just let the masks be specified.
The current code allows any pin/bit (mask) that is wanted/needed but does assume positive logic
to drive the backlight.
It wasn't clear to me what you were wanting/asking for.
Are you wanting support for inverted logic on the backlight?
i.e. logic 0 turns the backlight on and logic 1 turns the backlight off?
(have you seen a board out there that does it this way?)
I think to support both positive and negative logic there has to be more than a single
piece of information regardless of whether it is a bit number or a mask.
So it would need either a bit number and a flag or two bit masks.
Since all the other connections are specified in bit numbers, I'd lean towards a bit number and a positive/negative
logic flag for the backlight rather than two bitmasks.
Now if there is a desire to support dimming through multiple output pins, then it does get a bit more complicated
in that now there must be a way to deal with how to map the intensity to the multiple pins.
Say for example I have an extra pin on my SR. I could two 2 pins to 2 transistors with two different resistors and
now I have the ability to do 3 intensities and off.
What were you thinking?
--- bill