LM35DZ + Temp


Results 1 to 14 of 14

Thread: LM35DZ + Temp

Threaded View

  1. #1
    Join Date
    Jun 2006
    Location
    Greece
    Posts
    302

    Default LM35DZ + Temp

    I have the code below to show the temperature on LCD
    The code works but i want to show on Lcd and the decimal value,
    but i cann't
    Like this : Temp=25.6C
    Code:
    ' **Setting for ADC of 16F88**
    
        Define ADC_BITS 10          ' 10-bit ADC used
        Define ADC_CLOCK 3          ' Internal clock used
        Define ADC_SAMPLEUS 50      ' Sample timing
    
        Samples var word            ' Samples
        Sample var byte             ' Sample
        Vin var Word                ' Vin is variable
    
        Samples=0
    
    ADCloop:
    
        For Sample=1 to 10          ' Take 10 samples
        ADCIN 2, Vin                ' Read ADC ch-2 and save in Vin
                                    ' (range 0-1023)
        Samples=Samples + Vin
        Pause 200                   ' Wait for LCD to startup
                                    ' Seems to be appropriate.
        Next sample
        
        Vin=Samples/10              ' Mean of 10 Vin values
        Vin=(Vin*/500)>>2
    
        Lcdout $fe, 1               ' Clear LCD
        LCDOUT $FE,2              
        Lcdout "Temp=",Dec2 Vin,"C" 
    
        Samples=0
    
        goto ADCLoop
    Last edited by savnik; - 3rd March 2007 at 19:02.

Similar Threads

  1. Graphic LCD with PICbasic pro
    By amindzo in forum mel PIC BASIC Pro
    Replies: 41
    Last Post: - 25th November 2012, 11:45
  2. Stuck with 85C temp on ds18b20
    By revelator in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 3rd April 2009, 19:50
  3. Random Numbers
    By BobEdge in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 18th December 2008, 08:47
  4. help with write command
    By cphillips82 in forum General
    Replies: 9
    Last Post: - 20th April 2008, 23:49
  5. LM35DZ and 18F2455 settings
    By Mark J in forum mel PIC BASIC Pro
    Replies: 18
    Last Post: - 25th January 2008, 08:31

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