Write Onewire data toa I2C memory / read ASCI


Results 1 to 40 of 68

Threaded View

  1. #22
    Join Date
    Nov 2007
    Posts
    60


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by inse View Post
    Hi Eugeniu,

    as I have already explained in my first post:
    use the DIG modifier to separate the single digits of your calculated temperature.
    Then simply add 48 to each digit and you will get the ASCII code.

    If temperature is 2555 for 25.55°C
    n0 = (temperature dig 0) + 48

    n0 is 48+5 = 53 = ASCII "5"
    ...

    Regards,

    Ingo
    Dear Ingo ,

    I work by many days to do this and in my mind is a black hole. Please if you wish to help me , write a example ,

    i2cwrite I2CDAT, I2CCLK, $A0, adr,[TELL ME WHAT i MUST TO WRITE HERE ]

    I think that you now formula for temperature measurement with Onewire sensor ( one from others ) :
    " temperature = (((temperature >> 1) * 100) - 25) + (((count_per_c - count_remain) * 100) / count_per_c) "

    If I will write :

    LCDOUT $FE, $C0, DEC TEMPERATURE
    I'll be reading 2555

    For LCDOUT and to see a comma , I use this formula :
    lcdout "temp= " , dec temperature/2 ,"," , dec2 100- (100/16)*(count_remain)," gr.C"

    , but ....If I write in EEPROM :

    i2cwrite I2CDAT, I2CCLK, $A0, adr,[temperature]

    When I will read it with my FORMULA :

    i2cread I2CDAT , I2CCLK , $A0,J,[caracter]
    in " caracter "will can be read , time to time , a single sign / not a cipher
    Last edited by Eugeniu; - 16th October 2008 at 20:46.

Similar Threads

  1. I2C Master/Slave 16F88/16F767 working code
    By DanPBP in forum Code Examples
    Replies: 2
    Last Post: - 23rd October 2012, 22:31
  2. Cleaning up code
    By Tobias in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 2nd December 2009, 07:14
  3. HARDWARE I2C SAMPLE CODE question
    By Michael Wakileh in forum Code Examples
    Replies: 2
    Last Post: - 16th June 2009, 21:07
  4. Need the code to write to a memory
    By Hamlet in forum General
    Replies: 0
    Last Post: - 20th August 2007, 00:22
  5. Sinus calculating !
    By Don Mario in forum mel PIC BASIC Pro
    Replies: 29
    Last Post: - 28th November 2004, 23:56

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