Reply To: pc sender nxt with nxc receiver

HomeForumsMonoBrick Communication Librarypc sender nxt with nxc receiverReply To: pc sender nxt with nxc receiver

#3958
Author Image
Bartłomiej Drozd
Participant

ok, i solved this problem. I noticed, i must to send 5 times the same string to nxt, then nxt receive it correctly.
In c# it’s look that:

bool f = true;
Console.WriteLine("Y: ");
data = Int32.Parse(Console.ReadLine());
command = data.ToString();
if (f == true) //because first time send correctly
{
  brick.Mailbox.Send(command, Box.Box1, false);
  f = false;
}
brick.Mailbox.Send(command, Box.Box1, false);
brick.Mailbox.Send(command, Box.Box1, false);
brick.Mailbox.Send(command, Box.Box1, false);
brick.Mailbox.Send(command, Box.Box1, false);
brick.Mailbox.Send(command, Box.Box1, false);
brick.Mailbox.Send(command, Box.Box1, false);
Console.WriteLine("Y pos: " + command);
Posted in

Make a donation