Code: Select all
Ummm, 2 different things, one is called parameters. Since the program is running in the NXT, you really do not have a way of passing parameters. It is a 'main' task, not 'main' in the traditional C sense.
right, that was my bad, I explained it kinda poorly... I am thinking of the NXT as a terminal command, that could be run by sending it arguments and parameters... Since one of the functions in the 'NeXT Tools' program I am using is 'send message', I was thinking of controlling the NXT from there. I think my question is much better explained by showing my code.
My code: (most taken from the NXC language guide at
http://bricxcc.sourceforge.net/nbc/nxcd ... index.html
Code: Select all
task main()
{
MessageReadType args;
args.QueueID = MAILBOX1; // 0
// args.Remove = true; // ???
SysMessageRead(args);
if (args.Result == NO_ERR) {
TextOut(0, LCD_LINE1, args.Message);
Wait(SEC_1);
} else {
TextOut(0, LCD_LINE1, "no message found.");
Wait(SEC_1);
}
}
my understanding is that my creating a variable of type 'MessageReadType', an array of every message is created called 'args'.
'args.QueueID = MAILBOX1;' tell args to start reading at and stop reading after mailbox 1
'SysMessageRead(args);' tells the brick to read args (as instructed)
then the if statement says to print out the message if one is found, and to print out "no message found" if there is no message to read..
I keep getting the "no message found.", what am I doing wrong to allow the brick to read and print a message?