Behavior LightSensor

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

Moderators: roger, 99jonathan, imaqine

Behavior LightSensor

Postby Stone » Thu Oct 04, 2012 12:45 pm

Hi,
I have some problems with the LightSensor class. When I call the setFloodLight(true) method of my LightSensor Object, the red LED of my lightsensor won't turn on. (all other methods work perfect).
But when I make an object of the ColorSensor class, and call the setFloodLight(true) method of my ColorSensor Object, the floodLight works perfect. Has anyone an idea of what I am doing wrong?
(I am using the newest version of the LeJos firmware)

Gratz, Stone
Stone
New User
 
Posts: 14
Joined: Tue Apr 10, 2012 4:29 pm
Location: Belgium

Re: Behavior LightSensor

Postby gloomyandy » Thu Oct 04, 2012 1:04 pm

What sensor do you have? It sounds like you have a Lego Color Sensor not a Lego Light Sensor. The Color Sensor looks like this:
Image

The older light sensor looks like this:

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

Re: Behavior LightSensor

Postby Stone » Thu Oct 04, 2012 1:22 pm

Yes, I have the new color sensor. I thought that I could use the LightSensor class with the newer sensor for just measuring the brightness of the light.
But I see that you could also measure the light value with the colorsensor. The deception was that the other methods of the LightSensor Class worked great with my colorsensor.

Thanks for your response,
Stone
Stone
New User
 
Posts: 14
Joined: Tue Apr 10, 2012 4:29 pm
Location: Belgium


Return to NXJ Software

Who is online

Users browsing this forum: No registered users and 3 guests

more stuff