LCD BARgraphs


Closed Thread
Results 1 to 40 of 233

Thread: LCD BARgraphs

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    well, once you have the lcd working.. it's just a matter to have few IF-THEN conditions with your ADC value and few HIGH/LOW lines, and you should be in business... maybe i've misundertood something?
    Steve

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

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Does anyone know any code that will do that or give me a starting place to play with?
    I like this one. http://www.rentron.com/PICX2.htm

    It is a little more complicated than ADCIN, but it is still the method I use.
    Follow the code with the data sheet and it should become clear how the ADC works. Complete control.
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Mar 2008
    Posts
    79


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mister_e View Post
    well, once you have the lcd working.. it's just a matter to have few IF-THEN conditions with your ADC value and few HIGH/LOW lines, and you should be in business... maybe i've misundertood something?
    Your forgetting im a Pseudo Blonde
    I've no idea how to start off with ADC values or how to use them (at the moment) I've found the easiest way to learn something is by following examples that show you how to get started and then playing from there thats how I got the LCD working in the first place, and then the bargraph, then inputs and outputs... learning.. slowly!

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


    Did you find this post helpful? Yes | No

    Default

    No i didn't forget

    let's see first example in this thread
    Code:
    ; Initialize your hardware and LCD first.
    
    DEFINE ADC_BITS 8               ' Number of bits in ADCIN result
    ADCON1.7 = 1                    ' Right Justify AD result
    
    INCLUDE "LCDbar_INC.bas"        ' Include the BARgraph routines
    
    Value  VAR  WORD                ' Must be a WORD even though AD is 8bit
    
    LCDOUT $FE, 1  ' Clear Screen
    
    Loop1:
        ADCIN  0, Value
        LCDOUT $FE,2,"Value = ",DEC Value,"   "
        ; syntax- BARgraph   Value, Row, Col, Width, Range, Style
        @         BARgraph  _Value,   2,   0,    16,   255,  lines
    GOTO Loop1
    You just need to monitor Value variable with some IF-THEN statements after ADCIN line

    Code:
    IF Value>200 then 
            LCDOUT $FE,2,"VALUE>200       "
            endif
    Steve

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

  5. #5
    Join Date
    Mar 2008
    Posts
    79


    Did you find this post helpful? Yes | No

    Default

    Thanks
    I think I'm starting to get parts of it I'll try tomorrow properly when my head isn't so tired
    however i do have one question, how do you tell the pic what port the input is on?
    ie if the pot was connected to portA.0 how would you tell the pic to measure and display the value of that port?
    Hope I've said that clearly enough, sometimes I'm better about thinking about things than trying to explain what I mean

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


    Did you find this post helpful? Yes | No

    Default

    ADCIN 0, Value

    check the datasheet, PORTA.0 is AN0
    Steve

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

  7. #7
    Join Date
    Apr 2008
    Posts
    7


    Did you find this post helpful? Yes | No

    Default really appreciate the writter

    I will use it to cell voltage indicator project

Similar Threads

  1. Is this code not initialising the LCD properly?
    By Platypus in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 30th January 2010, 19:14
  2. 16f688 LCD what have I done wrong
    By spitfiredriver in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 8th August 2009, 19:54
  3. Play with LCD on PICDEM
    By The IceMan in forum mel PIC BASIC
    Replies: 5
    Last Post: - 22nd August 2008, 16:56
  4. Need help with LCD number display.
    By Steve Matson in forum mel PIC BASIC
    Replies: 8
    Last Post: - 26th June 2007, 23:07
  5. LCD will not start
    By btaylor in forum mel PIC BASIC Pro
    Replies: 49
    Last Post: - 24th May 2007, 02:30

Members who have read this thread : 2

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