View unanswered posts | View active topics It is currently Sat Sep 26, 2020 8:09 am

Reply to topic  [ 1 post ] 
send data from pc to robotc on nxt 
Author Message

Joined: Thu Jul 24, 2014 5:01 am
Posts: 1
Post send data from pc to robotc on nxt
Hey all,

I'm trying to send some integers from my pc through usb to the nxt block. I'm using monobrick on the pc and robotc on the nxt.

When i'm sending the data to the mailbox it receives data but more than i expect and it does not seem to be the correct content.

If i'm sending an ascii string to the mailbox i should be able to display this on the nxt right?

I'm using the following robotc code:

TFileIOResult nBTCmdRdErrorStatus;
const TMailboxIDs kQueueID = mailbox1;

   nSizeOfMessage = cCmdMessageGetSize(kQueueID);
      if (nSizeOfMessage <= 0)
         wait1Msec(1);    // Give other tasks a chance to run
         return;           // No message this time
     if (nSizeOfMessage > kMaxSizeOfMessage)
       nSizeOfMessage = kMaxSizeOfMessage;
     nBTCmdRdErrorStatus = cCmdMessageRead(nRcvBuffer, nSizeOfMessage);
    nxtDisplayTextLine(0, "bericht:%s", nRcvBuffer);
   nxtDisplayTextLine(6, "lengte:%d", nSizeOfMessage);

in monobrick i'm doing the following:
The numbering of mailboxes start from 0 in mono instead of 1 like in robotc.

 var brick = new Brick<Sensor,Sensor,Sensor,Sensor>("usb"); 
brick.Mailbox.Send( "10 10 1",Box.Box0, true);

Does anyone have an idea what i'm doing wrong?

thanks in advance

Thu Jul 24, 2014 5:57 am
Display posts from previous:  Sort by  
Reply to topic   [ 1 post ] 

Who is online

Users browsing this forum: No registered users and 2 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.