Shop OBEX P1 Docs P2 Docs Learn Events
Communicating with other Micros — Parallax Forums

Communicating with other Micros

ShredderShredder Posts: 19
edited 2006-08-18 20:28 in BASIC Stamp
I posted this in the ooPic group also and we are trying to figure out whats going on. If you have ooPic experience also that would be tremendous! [noparse];)[/noparse]

Ok so my robot is using a ooPic for locomotion, and a Basic Stamp for
doing most other stuff. All the input is going to be going thru the
BS, and then sending out serial data via the SEROUT command, I send
serial data to the ooPic using a oSerialX object to recieve it. I
actually got this working for themost part, but I cant recieve more
than one character at a time for some reason. I assume it has to do
with flow control.

So far with the talk on the ooPic group.. it seems there is definetly a problem with flow control.. I am stumped at this point.

I am sending from the BS2 with this
SEROUT SO\FC, Baud, [noparse][[/noparse]"Hello!", CR]

here is a snippet of the code for the ooPic..

Dim BS2PX As New oSerialX
Dim InFromBS2 As New oBuffer
Dim MyLCD As new oI2C


//code dealing with BS2 communication

InFromBS2 = BS2PX;
MyLCD = InFromBS2;

The result of this is a "H" is printed to the LCD, so its only getting
the first character.

Now if I do this..

InFromBS2 = BS2PX;
MyLCD = InFromBS2;
InFromBS2 = BS2PX;
MyLCD = InFromBS2;
InFromBS2 = BS2PX;
MyLCD = InFromBS2;
InFromBS2 = BS2PX;
MyLCD = InFromBS2;
InFromBS2 = BS2PX;
MyLCD = InFromBS2;
InFromBS2 = BS2PX;
MyLCD = InFromBS2;

it then prints "Hello!" on the LCD.. so I seem to only be able to get
one character at a time.

If I do this

MyLCD = BS2PX;

I get the same result.. one character at a time.

Do I need to write a loop that keeps getting individual characters,
until it recieves a CR then put them as one string?

Comments

  • allanlane5allanlane5 Posts: 3,815
    edited 2006-08-18 19:10
    What is the default size of an 'oBuffer' object?

    And I assume the ".read" is the default "=" operation of the InFromBS2 object?

    I'd quit using so many 'default' methods. Surely there's a "readbuffer" method of some kind?
  • ShredderShredder Posts: 19
    edited 2006-08-18 20:28
    I am setting the size of the oBuffer, that was acctually from old code sorry

    Dim InFromBS2 As New oBuffer(20)

    default for "=" is read.. and without specifying what to read, it reads ".Value"

    I have tried also using this
    InFromBS2.String = BS2PX.String;
    which still gives me just one character at a time
Sign In or Register to comment.