Setting bits


Closed Thread
Results 1 to 10 of 10

Thread: Setting bits

Hybrid View

  1. #1
    Join Date
    May 2004
    Posts
    81


    Did you find this post helpful? Yes | No

    Default

    Well that certainly would work as well. Thanks. I was hoping there would be some kind of command like DCD that would just magicaly set all the bits on but I guess not. I might look into just manipulating the bits some how. then again, I havnt looked but how many CPU cycles does the lookup command take? anyone know?

  2. #2
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    No magic commands, but maybe this will do ...
    BarGraph is a Word var.

    Code:
    BarGraph=$FFFF<<(LEDcount-((BarData-RangeLOW)*LEDcount)/(RangeHIGH-RangeLOW))
    If the BAR is going the wrong way, just change it to shift right (>>).
    Last edited by Darrel Taylor; - 26th November 2009 at 20:02. Reason: >>
    DT

  3. #3
    Join Date
    Nov 2005
    Location
    Bombay, India
    Posts
    967


    Did you find this post helpful? Yes | No

    Default

    Wow Darell, that's an ace. I use this for scaling readings but never thought of it this way. Nice tip.

    Superb

  4. #4
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Thanks Jerson,

    bearpawz had most of it already, I just filled in the blanks.
    Then compiled, tested and heard ... Ohhh Yeeaaah, before I realized it was me talking.
    DT

Similar Threads

  1. Bits, Bytes Words and Arrays
    By Melanie in forum FAQ - Frequently Asked Questions
    Replies: 24
    Last Post: - 14th June 2016, 07:55
  2. Configuration bits setting problem
    By financecatalyst in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 26th August 2009, 17:25
  3. PICKit2 - warning about configuration words
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 26
    Last Post: - 4th August 2009, 14:01
  4. error on compiling
    By parker in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 16th June 2005, 14:31
  5. Trouble setting config. bits
    By jswayze in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 13th March 2004, 22:22

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