Adding a light sensor service to the NXT

Hi,

I have completed all the tutorials and all that, but am still a newbie with MSRS.

My problem is I'm trying to use my NXT light sensors (connected to port 1 and 2 on my NXT). I can't seem to get it congifured correctly though.

I tried looking through the \samples\Platforms\LEGO\NXT\LegoNXTServices\LegoNXTLightSensor.cs

to see how to do it from there, but I'm not getting it.

Also how come on the LegoNXTLightSensor.cs does it use the

Microsoft.Robotics.Services.AnalogSensor.Proxy;

instead of the

Microsoft.Robotics.Services.LegoNxt.LightSensor.Proxy;

?

My current project that I'm trying to use this with has the sonar configured correctly, and has the motors configured correctly (I'm basing my project of Tutorial4 which has the windows form for controlling the robots motors via the drive)

[923 byte] By [PhaedoHD] at [2008-3-5]
# 1
I have some code working with the light sensor. I can send it to you through email if you want, just let me know.

I have tried using the LegoNxt.LightSensor.Proxy instead of the AnalogSensor.Proxy, but nothing seems to change. I think they use analog instead because it is a more generic service and can be used for sensors other than the specific Lego light sensor.

However, using the example in the LegoNXT folder, I seem to get inaccurate readings from the light sensor. All of my readings are around 30, not the 1-100 range I would expect. Does anybody else know what causes this, or a way to get around it?

Kexyn at 2007-9-25 > top of Msdn Tech,Microsoft Robotics Studio,Microsoft Robotics - Decentralized Software Services (DSS)...
# 2

Anyone know why the light sensor value on the NXT isn't read in correctly?

PhaedoHD at 2007-9-25 > top of Msdn Tech,Microsoft Robotics Studio,Microsoft Robotics - Decentralized Software Services (DSS)...
# 3
I just sent you an email with an archive of my program. Extract the entire folder into your sample directory.

I hope my code helps you with your question, and if you can figure out why I'm getting seemingly inaccurate readings, I would love to hear from you. Hooray for teamwork!

Kexyn at 2007-9-26 > top of Msdn Tech,Microsoft Robotics Studio,Microsoft Robotics - Decentralized Software Services (DSS)...
# 4
It seems that more and more people are noticing the problem. I still haven't seen a solution though. Check out the posts titled "NXT Light Sensor" and "AnalogSensor State Not Accurate for NXT Light Sensor" in the Hardware Configuration and Troubleshooting forum. Hopefully with all the attention this problem is getting, somebody will be able to help us!
Kexyn at 2007-9-26 > top of Msdn Tech,Microsoft Robotics Studio,Microsoft Robotics - Decentralized Software Services (DSS)...

Microsoft Robotics Studio

Site Classified