Strings......and how to join them


Closed Thread
Results 1 to 18 of 18

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Default Continuing on.....

    Excellent call on the SEROUT. Good to know I can do that to join strings. I got this error though on the receiver....

    ERROR: Macro SERIN2STR?WL not found in macro file.
    ERROR: Macro HSEROUTSTR?W not found in macro file.

    Which means I need an include file somewhere.......

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by gringobomba14 View Post
    Excellent call on the SEROUT. Good to know I can do that to join strings. I got this error though on the receiver....

    ERROR: Macro SERIN2STR?WL not found in macro file.
    ERROR: Macro HSEROUTSTR?W not found in macro file.

    Which means I need an include file somewhere.......
    Are you using PicBasic or PicBasicPro?

  3. #3


    Did you find this post helpful? Yes | No

    Default

    PicBasicPro

  4. #4
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by gringobomba14 View Post
    PicBasicPro
    Which version?
    And what line exactly is causing your problem?

  5. #5


    Did you find this post helpful? Yes | No

    Wink well, the thing is............

    That problem has gone. For future reference, I am using version 2.47. The problem I'm having now is this. I have perfect radio communications between 2 16F877A's, at both short and long range, but I'm not having much success transmitting and then receiving variables.

    My TX line is :
    SEROUT2 PORTc.2,16780,[((id<<6)+(rhtc/100<<3)+(temp/100))]

    which seems not to be a problem

    my RX line is

    SERIN2 PORTc.4,16780,250,programstart,[str myvar\6]

    but I don't get what I send. I'm sure there is a glaring error somewhere, but when I hserout myvar I get numbers, but not what I sent

  6. #6
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by gringobomba14 View Post
    My TX line is :
    SEROUT2 PORTc.2,16780,[ ((id<<6) + (rhtc/100<<3) + (temp/100))]

    which seems not to be a problem

    my RX line is
    SERIN2 PORTc.4,16780,250,programstart,[str myvar\6]
    but I don't get what I send. I'm sure there is a glaring error somewhere, but when I hserout myvar I get numbers, but not what I sent
    You're only sending one byte, but expecting to receive 6? How does that work?

    And your SEROUT doesn't make a lot of sense...
    You're shifting id up 6 bits, adding in a number that may or may not fit into those next 3 bits, and doing the same thing with the last number. What's up with that?

    Maybe it would be best if you showed your code rather than your broken snippets.
    Last edited by skimask; - 18th July 2008 at 20:42.

  7. #7


    Did you find this post helpful? Yes | No

    Default hmmmm......

    I got the SEROUT line from your posting(yesterday, 19:49), but all I really want to do is send an id (25 or 35) and a 4 digit temp or humidity reading, then receive same using the serout2/serin2 commands. When I send the command to the remote module it receives it perfectly as it is a constant number and sends what it is asked to....

    receive: ' receive
    portc.1 = 1 ' switch on port
    pause 25 ' give radio 25 ms to slew
    SERIN2 PORTC.0,16780,250,main,[command]
    if command = 25 then goto tempsend
    if command = 35 then goto humsend
    goto main

    When I send 25 it goes to tempsend, when I send 35 it goes to humsend.

    My latest attempt to send what I want is as follows:
    tempsend:
    portc.1=0 ' Back to main
    lcdout $fe,1,"tx t" ' send to lcd
    portc.3=1 ' switch on tx
    for c =0 to 4 ' start 4 pass loop
    pause 150
    SEROUT2 PORTc.2,16780,[temp]
    PAUSE 100 ' Pause 100uS
    next c ' next pass
    portc.3=0 ' switch off tx
    goto main ' Back to main

    temp is a 4 digit number and comes from the SHT71 sensor and is displayed correctly on the LCD


    The above is received with:

    SERIN2 PORTc.4,16780,250,programstart,[str myvar\4]
    HSEROUT ["A= ",dec myvar," B= ",#myvar," C= ",myvar," ",32,13,10] ' Display result
    CLEAR ' Clear array

    so I can have an idea what is being received and work out how to make it what I want
    Last edited by gringobomba14; - 18th July 2008 at 21:17. Reason: quick few bits to make it easier to understand

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