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 well, it goes like this........

    Really, all I want to do is take a constant i(2 bits) add a variable in t(3 bits) add another variable in h(3bits) and make it all one long(ish) variable of 8 bits, so I end up with string = iittthhh. I guess I could "join" them in the serout2 command (serout2,portpin,mode,i,t,h) but that didn't seem to work very well for me

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by gringobomba14 View Post
    Really, all I want to do is take a constant i(2 bits) add a variable in t(3 bits) add another variable in h(3bits) and make it all one long(ish) variable of 8 bits, so I end up with string = iittthhh. I guess I could "join" them in the serout2 command (serout2,portpin,mode,i,t,h) but that didn't seem to work very well for me
    You might have wanted this intead of what you had:

    SEROUT2 portpin, mode, [ ( ( i << 6 ) + ( t << 3 ) + h ) ]

    The way you had it, all it would do would send out 3 different bytes of value corresponding to i, t, and h.

  3. #3


    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.......

  4. #4
    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?

  5. #5


    Did you find this post helpful? Yes | No

    Default

    PicBasicPro

  6. #6
    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?

  7. #7


    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

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