Compass module and I2C bus


Results 1 to 13 of 13

Threaded View

  1. #5
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    what happened to your results when you change to a Byte Sized variable? you should read something between 0-255

    NOW if you want to use a word sized variable, YOU MUST READ register #2, not 1, so try...
    Code:
    ControlByte VAR BYTE
    Register VAR BYTE
    ControlByte = $C0
    Register = 2
    '
    '
    '
    '
    i2cread dpin,cpin,ControlByte,Register,[bearing.highbyte, bearing.lowbyte]
    and you should read something in a range of 0-3599
    <img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=1249&stc=1&d=116582183 1">

    About now?
    Attached Images Attached Images  
    Last edited by mister_e; - 11th December 2006 at 07:30.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Similar Threads

  1. HARDWARE I2C SAMPLE CODE question
    By Michael Wakileh in forum Code Examples
    Replies: 2
    Last Post: - 16th June 2009, 21:07
  2. Oscillator stops when touching with a wire
    By Wilbert Ingels in forum mel PIC BASIC Pro
    Replies: 23
    Last Post: - 25th April 2008, 08:51
  3. PIC16F877 I2C programme
    By cooqo in forum mel PIC BASIC
    Replies: 3
    Last Post: - 21st April 2008, 10:02
  4. I2C Comm with Digital Compass HMC6352
    By jihlein in forum Serial
    Replies: 10
    Last Post: - 9th April 2008, 22:25
  5. I2C compass - Philips KMZ51
    By barkerben in forum General
    Replies: 0
    Last Post: - 25th December 2005, 20:10

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