Uh Oh. Ok, it work flawlessly until you start working with a very tight scale. An example is the volt meter. It usually displays information from 8V to 18V with the guages I am replacing. Unfortunatly, based on the formula there ends up being too small of a number to even light one LED. (or at least its not lighting anything up). I passed in a value of 13 for my test data. This is a valid number between 8 and 18. However, when you start using the formula (the one I came up with) here is what happens:
GraphVal = (16 - (X / ((GraphMax - GraphMin) / 16)))
GraphVal = (16-(13/((18 - 8)/16)))
GraphVal = (16-(13/(10/16)))
GraphVal= (16-(13/.625)
GraphVal = 16-20
GraphVal = -4!
Sorry, Ive never been horribly great at actual math. Now what? lol.
Bookmarks