I2C CONFUSION, Help needed please


Results 1 to 40 of 43

Threaded View

  1. #29
    Join Date
    Nov 2007
    Location
    West Covina, CA
    Posts
    219


    Did you find this post helpful? Yes | No

    Default Re: I2C CONFUSION, Help needed please

    Oh yeah, no Constants.
    Then give it to him straight!

    Have you tried clearing the LOC and Value variables at the beginning of each loop just in case? Start with a clean slate every time.
    Code:
    Main:
        Loc=0
        Value=0
    High Led : Pause 500: Low Led : PAUSE 500
        I2CWRITE SDA,SCL,$36,[LOC],Fail1
        I2CREAD SDA,SCL,$37,[VALUE] ,Fail2
        PAUSE 25
        DEBUG  Value,13,10
        PAUSE 250
        DEBUG "Done....",13,10
        
    WHILE 1 : WEND
    Goto Main
    
    Fail1:
    while 1:	toggle portc.2 : pause 50 : wend 
    goto main
    
    Fail2:
    WHILE 1
    	High Portc.2 : Pause 250 : Low PortC.2 : Pause 250
    WEND
    You're so close, I can smell it!
    Or was that someone in the room?
    Last edited by LinkMTech; - 27th July 2013 at 22:52.
    Louie

Similar Threads

  1. Sample code for I2C text LCD needed
    By Alexey in forum Code Examples
    Replies: 4
    Last Post: - 15th September 2011, 01:29
  2. TMR0 Confusion
    By retepsnikrep in forum mel PIC BASIC Pro
    Replies: 15
    Last Post: - 19th August 2011, 11:55
  3. HPWM confusion
    By lerameur in forum General
    Replies: 12
    Last Post: - 5th November 2006, 10:09
  4. HPWM confusion
    By rossfree in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 3rd November 2005, 16:50
  5. DIV32 confusion
    By dmairspotter in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 7th October 2005, 21:24

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