I've got to be missing something


Closed Thread
Results 1 to 6 of 6
  1. #1
    Join Date
    May 2008
    Posts
    21

    Default I've got to be missing something

    As the title says... I need to do something rather simple but for some reason I cannot think of an easy way to do it. I know that there has to be one.

    I'm recieving serial data and at the moment storing it bit by bit into a vector. For example 90.00;1.12;130.34

    Vector(1)=9
    Vector(2)=0
    Vector(3)="."
    ...

    So these numbers can vary in size and number of digits.


    I need to basically do the DIG command backwards...

    B0=123
    B1=B0 DIG 1

    This sets B1= 2.

    What I need is to take Vector(1) and Vector(2) and put them together in 1 variable. Which in this case would be 90

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Are you receiving the data as ASCII characters or as binary values?
    In other words, in your example above...
    Vector(1) --- is that a '9' as an ASCII character 9, ASCII value of $39 (57 decimal)?
    Or 9 as in $09, %1001, decimal 9, as in I've got 9 fingers up, and one finger down?

    If you're savvy enough (I like using that word savvy here lately ), you could look in the PBP manual under the SERIN2 statemen, and look at the DEC and WAIT modifiers. It just might (ok probably will) take care of everything for you without having to write a conversion routine.
    Last edited by skimask; - 18th July 2008 at 17:23.

  3. #3
    Join Date
    May 2008
    Posts
    21


    Did you find this post helpful? Yes | No

    Default

    decimal 57

  4. #4
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Perrin` View Post
    decimal 57
    Ok, again, look carefully at the SERIN2 command and it's modifiers.

    What exactly is the format of the string you are receiving? How is it terminated (if at all)?

  5. #5
    Join Date
    May 2008
    Posts
    21


    Did you find this post helpful? Yes | No

    Default

    I've solved the problem in another way.

  6. #6
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Perrin` View Post
    I've solved the problem in another way.
    How did you do it?

Similar Threads

  1. Missing a bit
    By l_gaminde in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 31st August 2009, 18:54
  2. I am missing something, what is wrong with this code?
    By manta_z in forum mel PIC BASIC
    Replies: 3
    Last Post: - 26th April 2009, 23:15
  3. PIC18F4550 Error[128] Missing Arguments
    By damalu in forum mel PIC BASIC
    Replies: 9
    Last Post: - 17th November 2008, 21:47
  4. MCP23016 missing D7 on I2CRead
    By TWSK in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 10th June 2007, 18:37
  5. What am I missing
    By PaulB in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 12th November 2004, 16:15

Members who have read this thread : 1

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