It doesn't really matter which point you use...port 4 apparently has some kind
of high-speed data bus available on it, but I don't think anything uses this
yet (and nxt-python doesn't know how to talk to it).
<snip>
> Light: 0
<snip>
Yeah, it's not reading the light sensor. Weird.
> There are errors but the beginning tell that light sensor isn't find... :(
The error is because the Ultrasonic Sensor is a digital sensor and will cause
an error if it's not connected. That's fine. I don't know why the light sensor
doesn't work, though...
> If I go ahead this problem, my goal is to follow a black line.
This is very hard, good luck!
> I think the script has to begin whith:
> import nxt, nxt.sensor
> b = nxt.find_one_brick()
> sensor= nxt.Sensor(b,2)
That should be:
sensor = nxt.Light(b, nxt.PORT_3)
> Now, I need to turn on the sensor and get the intensity reflected on the
> surface. I don't find the way to do this. Who can help me?
sensor.set_illuminated(True)
Maybe it will work after doing this? You should get values with:
sensor.get_sample()
--
Marcus Wanner
That's good. The program works for me.
> Here is my result:
> <nxt.sensor.generic.Light object at 0xb7160eac>
> 1023
> 1023
Strange. Usually, if it doesn't see the sensor, it returns 0.
> The lights never illuminated
This is also strange.
> If I put the sensor on black or white surface, the "get_sample response" ils
> always the same.
Yeah, it's not seeing the sensor for some reason.
> Conclusion: I'm not able to use it.
Does everything else you've tried with nxt-python work? If so, this may be a
hardware issue. Do other programs work with the light sensor? If so, please
add these lines to your prorgam just after "print sensor":
sensor.debug = True
b.debug = True
b.sock.debug = True
Sorry it's not working...
--
Marcus Wanner