Numeric Values


Closed Thread
Results 1 to 9 of 9

Thread: Numeric Values

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Smile Ohhhh

    Ok thank you! You´re right I have an array but then you are telling me there´s another way to get a string of characters serialy?? What do you mean with a "string string"?? Thank you very much I really appreciate it!

    Armando.

  2. #2
    Join Date
    Feb 2003
    Location
    Salt Lake City, Utah USA
    Posts
    517


    Did you find this post helpful? Yes | No

    Smile

    Quote Originally Posted by Armando Herjim
    ... What do you mean with a "string string"?? ...
    Poor choice of words on my part – there is no string variable in PBP. i.e., you cannot have RX_Var = “Hi There” in PBP even though it is allowed in most traditional BASIC programs if RX_Var is declared as a string variable (See Visual Basic for example). You can have

    X[0]=”H”
    X[1]=”i”
    X[2]=” “
    etc.

    You have a few choices from what I can see. You can make sure you always send and receive 4 digits of a decimal number and use DEC as Steve suggested. Or you could “roll your own” with your array values: (highly unoptimized but should get the point across)

    NewValue VAR WORD

    RX_Var[0]=51
    RX_Var[1]=52
    RX_Var[2]=53
    RX_Var[3]=54

    IF RX_Var[0] = “ “ THEN GoSomeWhere
    NewValue = RX_Var[0] - “0”

    FOR X = 1 to 3
    IF RX_Var[X] = “ “ THEN GoSomeWhere
    NewValue = (NewValue * 10) + RX_Var[X]-”0”
    NEXT X

    You also can probably do it with all the options of SERIN2 but I have not used them enough to be able to suggest the format. Someone else?

    Good Luck,

    Paul Borgmeier
    Salt Lake City, Utah
    USA

  3. #3
    Join Date
    Feb 2003
    Location
    Salt Lake City, Utah USA
    Posts
    517


    Did you find this post helpful? Yes | No

    Smile

    A quick after thought - why not just send and receive your data a low byte and a high byte of a word sized variable and be done.

    For example

    X var word

    X = 456 ' your "desired" value

    send
    X.lowbyte = 200
    X.highbyte = 1

    then X will be 456 - done.

    Paul

  4. #4


    Did you find this post helpful? Yes | No

    Smile Good Idea!

    Hey that seems to be an excellent idea. Thank you very much!!!

Similar Threads

  1. Formating numeric values to text
    By Andre_Pretorius in forum General
    Replies: 2
    Last Post: - 1st August 2009, 08:39
  2. WRITECODE stores wrong 14-bit word values in FlashMEM
    By BobPigford in forum mel PIC BASIC Pro
    Replies: 18
    Last Post: - 26th June 2009, 04:35
  3. Looking at pic basic pro symbol values in mplab 8.15a simulator
    By ukemigrant in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 16th May 2009, 13:18
  4. Funny PULSIN values: what is going on???
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 30th April 2008, 08:02
  5. 16F877A problem: "coupled" digital values
    By Lupo83 in forum General
    Replies: 16
    Last Post: - 4th December 2007, 12:46

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