Lookup


Closed Thread
Results 1 to 6 of 6

Thread: Lookup

Hybrid View

  1. #1
    actionplus's Avatar
    actionplus Guest

    Default Lookup

    Anyone familiar with LookUp command?
    here is what my problem is. I have large data to look up. About 200 points of data.
    Here is a small portion of it.

    LookUp adval["55,55.2,55.4,55.6,55.8,56,56.2,56.4,56.6,56.8,57, 57.2,57.4
    ,57.6,57.8,58,58.2,58.4,58.6,58.8,59,59.2,59.4,59. 6,59.8,60,60.2,60.4,60.6,60.8,61,61.2,61.4,61.6,61 .8,62,62.2,62.4,62.6,62.8,63,63.2,63.4,63.6,63.8"],point

    Now the problem is that it compiles fine if I have only 1 line of data like this.

    LookUp adval,["55,55.2,55.4,55.6,55.8,56,56.2,56.4,56.6"],point

    How can I keep continuing to the next line and so forth like the first example from above?

  2. #2
    Santana's Avatar
    Santana Guest


    Did you find this post helpful? Yes | No

    Default

    DO something Like This
    LookUp adval[55,55.2,55.4,55.6,55.8,56,56.2,56.4,56.6,56.8,57,5 7.2,57.4,_
    63.4,63.6,63.8],point

  3. #3
    actionplus's Avatar
    actionplus Guest


    Did you find this post helpful? Yes | No

    Default error

    Still giving an error message.
    says it is expecting "]"

  4. #4
    actionplus's Avatar
    actionplus Guest


    Did you find this post helpful? Yes | No

    Default Found the problem

    seem like the lookup table cannot contain any decimel points. Once I took of the decimals, it errors disappeared.

    Now, how can replace the decimal back into the lcdout command

    550 is suppose to be 55.0

    And

    2000 is 200.0

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


    Did you find this post helpful? Yes | No

    Default

    never us any LOOKUP but

    LookUp adval,["55,55.2,55.4,55.6",_
    "55.8,56,56.2,56.4,56.6,56.8,57",_
    "57.2,57.4,57.6,57.8,58,58.2,58.4,58.6,58.8,59,59. 2",_
    "59.4,59.6,59.8,60,60.2,60.4,60.6,60.8,61,61.2,61. 4",_
    "61.6,61.8,62,62.2,62.4,62.6,62.8,63,63.2,63.4,63. 6,63.8"],point

    dont return any errors


    let me know
    Steve

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

  6. #6
    Join Date
    Jul 2003
    Location
    Sweden
    Posts
    237


    Did you find this post helpful? Yes | No

    Post

    Hi Actionplus,

    It seems like you discovered that PBP cannot handle decimal numbers.

    If you want to diplay your data with a decimal you could write ...

    LCDOUT "Data = ", DEC data/10, ".", DEC1 data

    .... or, if you want a little more control over each digit .....

    LCDOUT "Data = ", DEC1 data DIG 4, DEC1 data DIG 3, DEC1 data DIG 2, DEC1 data DIG 1, ".", DEC1 data DIG 0

    /Ingvar

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. Lookup Table
    By yasser hassani in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 11th March 2008, 10:38
  3. ADCIN and LOOKUP ...
    By Acetronics2 in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 16th June 2007, 21:02
  4. problem with USART
    By leemin in forum Serial
    Replies: 4
    Last Post: - 11th December 2006, 17:56
  5. Confused On Dig & Lookup
    By SOMRU in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 5th December 2006, 21:49

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