Constants and Data wires

Discussion specific to NXT-G, NXC, NBC, RobotC, Lejos, and more.
Post Reply
ivanovonavich
Posts: 1
Joined: 21 Oct 2011, 18:49

Constants and Data wires

Post by ivanovonavich »

I'm fairly new to NXT 2.1. I'm coaching a team with our first event scheduled for Dec. In any case, I'm trying to stay one step ahead of the kids....

My problem is this:

We will be operating our NXT in an environment with a significantly different light setting than where we practice. Our solution, when using the light sensor, is to simply use "Constants" to set the min and max range to sense the white and dark lines on the Field Set Up board.

We have had great success in using constants controlling the "Power" of the "Move" blocks in association with the ultra sonic sensor.

However, we have difficultly with the light sensor set up. We have a logic controlled loop where we have inside, a constant block, a light sensor block and a timer; in that order. A wire is connected from the constant block on the "Value" port to the "Trigger Point" port on the light sensor in our desire that the sensor will use that constant to compare the value listed in the "Constant" verses what defaults into the window on the the light sensor. Then, a green logical YES/NO wire leaves the light sensor block to the loop controlled again by the YES/NO.

It doesn't seem to work. I don't know yet of a way to confirm the data values a sensor is looking at; namely, is my light sensor using the constant value input, or is it using the value in the box listed next to the slider?

Any thoughts anyone?

Ivan
muntoo
Posts: 834
Joined: 01 Oct 2010, 02:54
Location: Your Worst Nightmare
Contact:

Re: Constants and Data wires

Post by muntoo »

I re-posted here since it not really a software question....the forum where I initially placed it.
-------------------------------------------------------------------
I'm fairly new to NXT 2.1. I'm coaching a team with our first event scheduled for Dec. In any case, I'm trying to stay one step ahead of the kids....

My problem is this:

We will be operating our NXT in an environment with a significantly different light setting than where we practice. Our solution, when using the light sensor, is to simply use "Constants" to set the min and max range to sense the white and dark lines on the Field Set Up board.

We have had great success in using constants controlling the "Power" of the "Move" blocks in association with the ultra sonic sensor.

However, we have difficultly with the light sensor set up. We have a logic controlled loop where we have inside, a constant block, a light sensor block and a timer; in that order. A wire is connected from the constant block on the "Value" port to the "Trigger Point" port on the light sensor in our desire that the sensor will use that constant to compare the value listed in the "Constant" verses what defaults into the window on the the light sensor. Then, a green logical YES/NO wire leaves the light sensor block to the loop controlled again by the YES/NO.

It doesn't seem to work. I don't know yet of a way to confirm the data values a sensor is looking at; namely, is my light sensor using the constant value input, or is it using the value in the box listed next to the slider?

Any thoughts anyone?

Ivan
Anything connected by a datawire should override what it says in the block's "properties".

Can you post a picture and a program? (The program should be in a .7z file, for max compression. Then, you'll need to .zip it, so you can upload it here.)
Image

Commit to LEGO Mindstorms Robotics Stack Exchange:
bit.ly/MindstormsSE


Commit to LEGO Stack Exchange: bit.ly/Area51LEGOcommit
bungeshea
Posts: 207
Joined: 14 Aug 2011, 08:45
Location: Australia
Contact:

Re: Constants and Data wires

Post by bungeshea »

Okay, the first thing is, what do you need the timer block for?

The next thing you could try is removing the consistent block temporarily and entering your light values into the config panel. If it doesn't work, then it is a configuration problem, nothing to do with the consistent.

If you could try to upload a picture (screenshot) or your actual program, that would really help.
Post Reply

Who is online

Users browsing this forum: Semrush [Bot] and 1 guest