.8.5 on NXT2.0- Ultrasonic/Color Sensor don't return values.

This is where you talk about the NXJ software itself, installation issues, and programming talk.

Moderators: 99jonathan, roger, imaqine

.8.5 on NXT2.0- Ultrasonic/Color Sensor don't return values.

Postby johnv » Sat Sep 12, 2009 4:38 am

I have a NXT 2.0.
If I nxjflash with leJOS 0.8.0 then build and upload the View sample, I see the Ultrasonic Sensor working just fine (distance changes appropriately).

If I flash with leJOS 0.8.5 then build and upload the View sample, the Ultrasonic Sensor constantly shows 255.

On 0.8.5, the ColorTest fails to show any values as well (this obviously is not applicable to 0.8.0)

On 0.8.5 using the View Program, the touch sensor reads correctly.

Has anyone else tried 0.8.5 on NXT 2.0 with success?
johnv
New User
 
Posts: 5
Joined: Sat Sep 12, 2009 4:28 am

Postby gloomyandy » Sat Sep 12, 2009 8:09 am

Hi,
The Color Sensor works fine for me on all ports. The Ultrasonic Sensor works fine on all ports except port 4. It looks like I introduced a bug in 0.85 with i2c based sensors on port 4.

Can you recheck using different ports? What happens with your color sensor? I assume you are using the Lego Sensor (not the HTechnics one) and you are running the new ColorSensorTest program? Have you tried the various modes? Does the LED light up at all? I assume the sensor works with the Lego software?

Andy
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4084
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Postby BenR » Sat Sep 12, 2009 10:58 am

I have the same problem as johnv.

To answer your question gloomyandy, I tried the new ColorSensorTest sample on all sensor ports. The different LEDs light up and are fully controllable, but I get no color value.

The color sensor works fine with the Lego software.

But the difference I observed is that the Lego software doesn't turns the LEDs on to detect the colors.
BenR
New User
 
Posts: 6
Joined: Sat Sep 12, 2009 10:52 am

Postby gloomyandy » Sat Sep 12, 2009 12:43 pm

Hi,
When you say no color value are you getting any values displayed? There should be a full set of readings on the screen. Also how are you taking a reading? You will only get color detection when you are using FULLCOLOR mode (white light displayed).

The Lego sensor does turn on the light, it is just that the period is very short. With the leJOS test program we are sampling all of the time, so the light seems to be on all of the time.

Andy
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4084
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Postby gloomyandy » Sat Sep 12, 2009 12:52 pm

One other thing because the test program constantly takes readings, you must keep the brick or whatever you are checking the color of infront of the sensor. If you move it away, it will immediately report black/none...

Andy
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4084
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Postby BenR » Sat Sep 12, 2009 1:55 pm

Im getting only zeros except for Color, which says "none" of course and value = -1. (Mode = Full)

And Im not moving the nxt / color sensor.
BenR
New User
 
Posts: 6
Joined: Sat Sep 12, 2009 10:52 am

Postby johnv » Sat Sep 12, 2009 2:24 pm

When I move the Ultrasonic sensor to port3 it works, thanks.
On the color sensor I still get: (copy from display of ColorSensorTest sample)

Mode: Full
Color Raw Cal
Red 0 0
Green 0 0
Blue 0 0
None 0 0
Color: NONE
Value: -1
johnv
New User
 
Posts: 5
Joined: Sat Sep 12, 2009 4:28 am

Postby johnv » Sat Sep 12, 2009 2:26 pm

Oh, and I know it is at least partially working because it flashes to take the reading.
johnv
New User
 
Posts: 5
Joined: Sat Sep 12, 2009 4:28 am

Postby gloomyandy » Sat Sep 12, 2009 3:31 pm

Hi,
So when you are in red mode is the LED flashing on and off? And does the display show -1, -1 or does it show 0, 0?

Thanks

Andy
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4084
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Postby BenR » Sat Sep 12, 2009 4:06 pm

When in red mode the (red) led flashes and the display shows -1, -1.
BenR
New User
 
Posts: 6
Joined: Sat Sep 12, 2009 10:52 am

Postby gloomyandy » Sat Sep 12, 2009 4:29 pm

Hi,
OK it looks like there is a problem reading the calibration data from your sensors. I've created two test programs that have different sets of timing for the read and also a third that displays the data read. I've placed all of these in a zip file that can be found here:
http://www.gloomy-place.net/lejos/cst.zip

Please can you download this file, unzip it and then download the .nxj programs to your NXT and run them. Please select the red option and let me know what happens in each case.

The program that displays the data only pauses for 10secs so it may take a while to capture the output. The most important values are the ones on the bottom line. If they do not match then the CRC of the data read from the sensor is not a match.

Thanks for your help

Andy

PS All of these programs work fine with my Lego Color Sensor and on the four NXTs that I have access to...
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4084
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Postby gloomyandy » Sat Sep 12, 2009 4:32 pm

Oh and you can get the programs to your nxt using the nxjupload command

nxjupload -r cst1ms.nxj

etc....

Andy
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4084
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Postby drakkai » Sat Sep 12, 2009 5:40 pm

Hi there,

I am having the same problem. NXT 2.0 and the sensor is not returning anything. It also works fine under the Legos firmware.
I tried both test and neither of them are working. The give the same answer in the LCD.
drakkai
New User
 
Posts: 2
Joined: Sat Sep 12, 2009 5:36 pm

Postby gloomyandy » Sat Sep 12, 2009 5:42 pm

There are 3 tests. I need to see the output from the third cst4mslcd

Andy
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4084
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Postby BenR » Sat Sep 12, 2009 6:16 pm

Output from cst4mslcd:
Code: Select all
acb2 a35c a630
b9fb ab5c acff
c249 b125 b13b
f642 10d90fce0

134     af
ffff9bb09bb0


Didn't expected that after the first two tests :).
BenR
New User
 
Posts: 6
Joined: Sat Sep 12, 2009 10:52 am

Next

Return to NXJ Software

Who is online

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

more stuff