Whats the quickest way to set bits?


Results 1 to 34 of 34

Threaded View

  1. #5
    Join Date
    May 2004
    Posts
    81


    Did you find this post helpful? Yes | No

    Default

    DOH!

    I knew there was something I wasnt thinking of...

    The key was right shifting the $FFFF. If anyone else is following this, here is the final formula I came up with and it works perfectly.

    GraphVal = $FFFF >> (16 - (X / ((GraphMax - GraphMin) / 16)))

    This is for auto guages so the scale of the graph can swing. For instance, a fuel level gauge might read 0 to 16 galons, where a water temp guage might read 180° - 290°, so it was important to note that the bottom number might change as well as the top.
    Last edited by bearpawz; - 23rd October 2010 at 03:16. Reason: It works now...

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts