read temperature


Results 1 to 17 of 17

Threaded View

  1. #7
    breeno's Avatar
    breeno Guest


    Did you find this post helpful? Yes | No

    Unhappy

    i'm desperate!!!
    i have changed scl and sda pins to portB..nothing
    i have changed resistor to 4k7....nothing

    this is my all code:


    @ DEVICE XT_OSC, WDT_OFF, PWRT_ON, PROTECT_OFF

    DEFINE LCD_DREG PORTB
    DEFINE LCD_DBIT 4
    DEFINE LCD_RSREG PORTB
    DEFINE LCD_RSBIT 2
    DEFINE LCD_EREG PORTB
    DEFINE LCD_EBIT 3
    DEFINE LCD_BITS 4
    DEFINE LCD_LINES 2

    ' DEFINE I2C_SCLOUT 1


    SCL var PORTA.2
    SDA var PORTA.3

    TEMP var BYTE
    TEMP=0


    MAIN:
    PAUSE 1000
    LCDOUT $FE, 1
    LCDOUT #TEMP
    ' i2cwrite sda,scl,$9A,$1,[$00],NOREAD
    i2cwrite sda,scl,$9A,$1,[$00]
    ' pause 1000
    i2cread sda,scl,$9A,$0,[temp] ' Read temperature
    goto prox
    noread: lcdout "noread"

    prox: GOTO MAIN
    END


    with the noread label the display always screens "0 noread"
    without noread label the display always screens "2"

    the same thing also with the pause between write and read and with or without the I2C_SLOUT option

    i attach an image with the hardware config...

    please save me!!!!!
    thanks!!!!
    Attached Images Attached Images  

Similar Threads

  1. Cleaning up code
    By Tobias in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 2nd December 2009, 07:14
  2. SEROUT WORD variable problem
    By Tobias in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 19th April 2009, 11:20
  3. Changing declared variables names on the fly
    By jessey in forum mel PIC BASIC Pro
    Replies: 15
    Last Post: - 16th December 2006, 06:34
  4. Serout "onewire.bas"
    By puru in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 6th July 2005, 00:14
  5. read temperature sensor
    By breeno in forum General
    Replies: 5
    Last Post: - 10th January 2005, 06:04

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