I know RTFM, but why?


Closed Thread
Results 1 to 6 of 6

Hybrid View

  1. #1
    Join Date
    May 2006
    Location
    Del Rio, TX, USA
    Posts
    343


    Did you find this post helpful? Yes | No

    Default

    Jumper,
    Why not solve your problem by always using the STR modifier? For a single word, just use something like:

    Code:
    a var word[8]
    I2CWRITE datapin,clockpin,control,(address),[STR a\1]
    .....
    I2CREAD datapin,clockpin,control,(address),[STR a\1]
    For X Words, use:
    Code:
    a var word[8]
    I2CWRITE datapin,clockpin,control,(address),[STR a\X]
    .....
    I2CREAD datapin,clockpin,control,(address),[STR a\X]
    This should keep you from having to think about which order the bytes are stored in.

    Steve

  2. #2
    Join Date
    Mar 2006
    Location
    China
    Posts
    266


    Did you find this post helpful? Yes | No

    Default I will

    It seems to be a good idea as you point out to always use the STR function. Everybody sais that PbP has few bugs, I would like to call this a bug but since the manual mentions that the I2C command will return different data compared how variables are usually stored it has to be a feature :-)

    Thanks for taking time to think about this and if anyone ever find a reson why PBP has decided to go this way I still would like to know.

Similar Threads

  1. New version of Pic BASIC Pro released
    By Demon in forum mel PIC BASIC Pro
    Replies: 15
    Last Post: - 12th March 2010, 15:41
  2. Using both DIV32 and LONGs together
    By BrianT in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 9th January 2009, 12:46
  3. 18F Config fuses
    By Angus Anderson in forum mel PIC BASIC Pro
    Replies: 20
    Last Post: - 18th December 2007, 15:59
  4. How about a thread that replaces RTFM and RTFDataSheet:
    By blainecf in forum PBP Wish List
    Replies: 12
    Last Post: - 13th August 2007, 17:46
  5. Set bits of Word problem
    By pdegior in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 3rd September 2005, 22:44

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