Compare Data


Closed Thread
Results 1 to 10 of 10

Thread: Compare Data

Hybrid View

  1. #1

    Default Compare Data

    Hi,

    IŽneed a Solution for my Firmware,I must to compare Received Data,but the Problem is that the lenght of the strings are not always the same.

    For Example i send $WP+CALL=12345... and I should receive this $OK:CALL or $ERR:CALL when I use this $WP+GSMINFO=1234 i should receive $MSG:GSMINFO="xxx",27,0,0.

    All the answers have this first character "$" and I want to put the Answer on my LCD.

    Receive:
    Dummy[Input_Byte_Count] = RCREG ' Clear USART Flag by reading USART data
    If Dummy[0] = 36 then ' Character $
    High LCD_Light
    Lcdout $fe, 1 ' Clear screen
    If Dummy[Input_Byte_Count] = 10 then 'Line Feed
    Pause 5
    Lcdout $fe,$80,str Dummy\Input_Byte_Count+1
    Pause 5
    Input_Byte_Count = 0
    else
    Input_Byte_Count = Input_Byte_Count + 1
    endif
    else
    Dummy[0] = $00
    endif
    Resume

    Is this a good way to do this ?

    Thanks for any answer

    Regards Pesti

  2. #2
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default

    Pesticida, Is there some EOL character sent at the "End of Line"? You can use this character (ie.CR/LF) as a terminator for the input string to your LCD display...

    Dave Purola
    N8NTA

  3. #3


    Did you find this post helpful? Yes | No

    Default

    Hi,

    Yes Feed New Line.

    Regards Pesti

  4. #4


    Did you find this post helpful? Yes | No

    Default

    I think that my Problem is that if I use Dummy=RCREG with RCIF Interrupt I become a overflow.

    I must to try with Hserin.

    Regards

  5. #5
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Pesticida View Post
    I think that my Problem is that if I use Dummy=RCREG with RCIF Interrupt I become a overflow.

    I must to try with Hserin.

    Regards
    And again, just like the last bunch of posts, you answer awaits you in the PBP manual...It's all about terminating the SERIN2/HSERIN input with an optional character...
    It's in the book if you just take the time to look.
    I understand what you're trying to do and as soon as you read the book, really read the book, the answer will show up...right in front of you...especially since you said that each line is ended with some sort of optional character, in your case, a line feed character.

  6. #6


    Did you find this post helpful? Yes | No

    Default

    Sorry but i dont have exactly explain my Problem,I know how this work but my problem is how to make a routine that check for example if I receive this $OK:CALL, then is the call ok and so on.

    How to verify Long strings?

    I send this $WP+CALL=12345... and then from gsm module receive $OK:CALL.

    Thanks Skimask

Similar Threads

  1. Using Nokia LCD
    By BobP in forum mel PIC BASIC Pro
    Replies: 300
    Last Post: - 3rd May 2018, 04:47
  2. Nokia 3310 display text
    By chai98a in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 26th August 2007, 03:39
  3. Big characters on HD44780 4x20
    By erpalma in forum mel PIC BASIC Pro
    Replies: 23
    Last Post: - 7th January 2007, 02:21
  4. LCD + bar graph
    By DynamoBen in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 5th October 2005, 14:50
  5. Sinus calculating !
    By Don Mario in forum mel PIC BASIC Pro
    Replies: 29
    Last Post: - 28th November 2004, 23:56

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