Actually, Josh, this is basic high school math. Unless you actually are a high school student and haven't gotten to logarithms and exponentials yet, you have no business trying to be an engineer. You can get through high school math, with good grades, without gaining much of an understanding about how logarithms get applied to the real world. More people tend to forget their basic calculus, "required" in college but never really used. I know that the last time I looked at my college physics text, there were an awful lot of symbols that I don't remember how to work with (gradients and laplacians and ... stuff.) One need not be "trying to be an engineer" to want to play with PICs and pretty colored LEDs. If an artist (for example) gets led into technical issues in their search for an effect, that's OK. If they end up understanding that there's method and science behind the scenes, that's good (IMO), and if they end up actually digging in and relearning their "high-school-level math", that's quite excellent. Historically, this has been more common in analog electronics and music, I think. But I don't think that us "REAL Engineers" ought to be too upset at having to explain things every once in a while. It can be better than being asked to IMPLEMENT an effect at a level we don't understand either. So... We're trying to get preceived linear (smooth) brightness changes in a LED by matching the (supposedly) logarithmic response of the human eye/etc. A "logarithmic series" is one where the next value in the series is calculated by multiplying the previous value by a constant. S0 = A S1 = S0 * C = A * C S2 = S1 * C = A * C * C S3 = S2 * C = A * C * C * C : Sn = A * C^N So if S0 = 1, and Sn = 255, for instance, we know that A = 1, and 255 = C^n, where N is the number of steps in the series. To solve for C, take the Nth root of both sides C = root(255, N) An Nth root is equivilent to raising to the power 1/N (this is derived from logarithm theory), and this is the "m" factor that Olin's program calculates, more or less: m = max_out^(1.0/max_in - 1) m = 255^(1/254) BillW -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.