learning....unexpected results with RGB led

Hello,

Fairly new and trying to learn so don't hate :)

I have an UNO connected to a sparkfun 16x2 LCD with backpack, spectra softpot, and a controllable RGB led amplifier / 16ft led strip.

I've jumbled together code from various sketches I've come across as well as some of my own and all seemed to work pretty well until I got an lcd attached. I didn't initially notice during my fade tests that each LED was working backwards where "0" was full on and "255" was off. With the LCD it was apparent when I displayed the red LED level and at 255 I had no red. whats the best way to get the correct outputs short of inverting all the values manually? I read about mapping but I dont understand how that would invert it the way Im trying to. Do i need to pull up or down the led pins? What other ways are possible (for learning sake).

I don't want to be given any code, just a little direction to learn.

whats the best way to get the correct outputs short of inverting all the values manually?

A simple subtraction.

analogWrite (255 - desiredLevel);

Yours is presumably a common anode LED.

Well, you could just:

Analogwrite(pin, 255-redvalue);

That will be the easiest fix :-)

edit: AWOL beat me to it... LOL

Otherwise you will be looking at building logic inversion circuits, etc.

thank you for putting up with my ignorance :D Works perfectly. Thank you both for the professional replies. Im going to like it here :grin: