Page 1 of 1

Using utility "Watching the Brick"

Posted: 18 Dec 2011, 11:31
by robotsoftware
Hello

Is it possible to show every variable that I'm using in my NQC program via the utility "Watching the Brick"?

Is there an example of how to do?

I wont to use the watch brick via bluetooth to see the behavior of my program.

Or are there other possibilities to watch the variable used in my program?

Thanks in advance.

Jan Kromhout
Hellevoetsluis

Re: Using utility "Watching the Brick"

Posted: 18 Dec 2011, 19:47
by mattallen37
The RCX only supports 32 global variables (all int). The only others are the 16(?) local variables supported (only?) by 2.0 FW. I don't know of any way to monitor those.

Also, unless you did some HW (and FW?) hacking, the RCX doesn't support bluetooth, just IR.

If you are talking about the NXT, you can't use NQC to program it. Instead, you should use NXC (for the NXT instead of the RCX). you can use the "Configurable Watch" tool to monitor any of the variables (even the ones that you didn't declare, that the compiler made for your program to run). As long as you have a connection to the NXT from BCC, it doesn't matter if it's BT or USB.

Re: Using utility "Watching the Brick"

Posted: 18 Dec 2011, 21:27
by robotsoftware
Thanks for the reply.
I try to use this "Configurable Watch" but I have some trouble with it, and the help is not helping :(

This is my simple code

long counter=0;
task main()
{
while (true)
{
counter+=1;
Wait(1000);
}
}

How can I watch the variable counter?
Please can you help me with this.
I use the nxt.

Cheers,


Jan Kromhout
Hellevoetsluis-NL

Re: Using utility "Watching the Brick"

Posted: 19 Dec 2011, 03:25
by mattallen37
Well, because you never used variable "counter" for anything, the compiler optimization decided it was pointless do make the processor think about it, and it just cut it out of your code when it compiled.

Try this:

Code: Select all

long counter=0;
task main()
{
  while (true)
  {
    counter+=1;
    ClearScreen();
    NumOut(0, LCD_LINE1, counter);
    Wait(1000);
  }
}
Not only will it display the value of counter on the screen, but it will also now show up on the list of variables in the configurable watch tool.

Re: Using utility "Watching the Brick"

Posted: 19 Dec 2011, 21:11
by afanofosc
If you are using an NXT and NXC and a relatively recent test release of BricxCC then you can also use the NXT Watch List tool. I will upload a video showing how to use it later tonight.

John Hansen

Re: Using utility "Watching the Brick"

Posted: 27 Dec 2011, 20:35
by robotsoftware
John,
Thanks for the response.
I download and installed the latest version of 16 december 2011. The only tool I see is the Configurable Watch.
Is this the one you talk about?

Regards,

Jan Kromhout
Hellevoetsluis-NL

Re: Using utility "Watching the Brick"

Posted: 28 Dec 2011, 17:51
by afanofosc
I've attached a zip containing an m4v video that demonstrates some of the watch features in BricxCC.
watching.zip
(1.42 MiB) Downloaded 335 times
John Hansen

Re: Using utility "Watching the Brick"

Posted: 29 Dec 2011, 19:07
by robotsoftware
John,

Thanks for this inspiring video.
It helps me allot.
One thing is not clear for me.
Is it posible to watch continues the Watches in the NXT Watch list?

Regards,

Jan Kromhout
Hellevoetsluis-NL

Re: Using utility "Watching the Brick"

Posted: 30 Dec 2011, 03:34
by afanofosc
Is it posible to watch continues the Watches in the NXT Watch list?
I don't really understand your question but perhaps you are asking whether you can turn on a regular polling for values in the NXT Watch List tool? At the moment you cannot turn on some sort of periodic polling with this newest Watch tool. Perhaps in a future release I will add something like that - along with integration with the graph tool. And, to be clear, most of the options in the watch edit window are non-functional at the moment.

If that is not what you were asking about could you try to rephrase or clarify what you are asking?

John Hansen