Using utility "Watching the Brick"

Discussion specific to NXT-G, NXC, NBC, RobotC, Lejos, and more.
Post Reply
robotsoftware
Posts: 6
Joined: 18 Dec 2011, 11:16

Using utility "Watching the Brick"

Post 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
mattallen37
Posts: 1818
Joined: 02 Oct 2010, 02:19
Location: Michigan USA
Contact:

Re: Using utility "Watching the Brick"

Post 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.
Matt
http://mattallen37.wordpress.com/

I'm all for gun control... that's why I use both hands when shooting ;)
robotsoftware
Posts: 6
Joined: 18 Dec 2011, 11:16

Re: Using utility "Watching the Brick"

Post 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
mattallen37
Posts: 1818
Joined: 02 Oct 2010, 02:19
Location: Michigan USA
Contact:

Re: Using utility "Watching the Brick"

Post 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.
Matt
http://mattallen37.wordpress.com/

I'm all for gun control... that's why I use both hands when shooting ;)
afanofosc
Site Admin
Posts: 1256
Joined: 26 Sep 2010, 19:36
Location: Nashville, TN
Contact:

Re: Using utility "Watching the Brick"

Post 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
Multi-platform LEGO MINDSTORMS programming
http://bricxcc.sourceforge.net/
robotsoftware
Posts: 6
Joined: 18 Dec 2011, 11:16

Re: Using utility "Watching the Brick"

Post 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
afanofosc
Site Admin
Posts: 1256
Joined: 26 Sep 2010, 19:36
Location: Nashville, TN
Contact:

Re: Using utility "Watching the Brick"

Post 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 325 times
John Hansen
Multi-platform LEGO MINDSTORMS programming
http://bricxcc.sourceforge.net/
robotsoftware
Posts: 6
Joined: 18 Dec 2011, 11:16

Re: Using utility "Watching the Brick"

Post 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
afanofosc
Site Admin
Posts: 1256
Joined: 26 Sep 2010, 19:36
Location: Nashville, TN
Contact:

Re: Using utility "Watching the Brick"

Post 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
Multi-platform LEGO MINDSTORMS programming
http://bricxcc.sourceforge.net/
Post Reply

Who is online

Users browsing this forum: Semrush [Bot] and 15 guests