Ok, I kind of see where your going. What I need to do is something very similar. If I understand correctly DCD will set the specified bit. Here is what the help in MCS says:

"DCD returns the decoded value of a bit number. It changes a bit number (0 - 15) into a binary number with only that bit set to 1. All other bits are set to 0.

Example

B0 = DCD 2 ' Sets B0 to %00000100"

Ok, thats cool. And after re-reading that other thread I see where your going with this. Lets say I know my bargraph needs to display 50% or 8 segments. I would need to say something like DCD = 8. This gives me %10000000. So in effect only my 8th LED will light up. My problem is I need ALL the LED's from 1 to 8 to light up... what I need to see is %11111111.

Using ~DCD is ALMOST what I need. For the number 8 I would now have 011111111. Close but not quite. Just for fun, lets say that I really need only 4 led's lit up. (%00001111). Using ~DCD I would actually get %11110111). Do I understand this correctly?

Anyway, now that I have actually had some sleep. I can think a wee bit more clearly. Using the look up table should work, just seems there should be an easier way to do this. For anyone following along I figured out my final formulat. I will need three peices of information: Bargraph upper bound, Bargraph lower bound, and value. (And yes, I have spent WAY too many years messing around with arrays in VB ).

Here is my final formula then:

Bargraph = (Data - LowBound) / ((highbound - lowbound)/16)

Simplest samples to plug in with oil pressure values: Upper is 32, lower is 0. For a presure of 16 (50% on the bargraph) I need to light 8 led's

Bargraph = (16 - 0)/((32 - 0)/16)
bargraph = 16/2 = 8.

So now I just need to tell the pic to light up LED's 1-8 and I am done. Until I get a better lightbulb over my head, Im just using a look up table. then of course, there will be the issue of getting the values IN to the processor.. but thats a whole other war to battle.