Page 1 of 2

Light sensor

Posted: 17 Nov 2010, 16:56
by bodybuilder09
I have no idea how to work the light sensor. I have watched a video to see how to program and calibrate it but it still doesn't work. I have no idea what to try. If anyone can help me or knows what the problem is I would greatly appreciate you telling me. And I need to know before December 11th that's when our competition is.

Re: Light sensor

Posted: 17 Nov 2010, 19:04
by mattallen37
What do you mean "program and calibrate"? First, what language are you using? Second, the sensor cannot be calibrated. To "calibrate" the light sensor, you just code to make up a difference in values, but there is no light sensor memory (it is an analog sensor).

Re: Light sensor

Posted: 17 Nov 2010, 21:00
by bodybuilder09
I am part of the FLL 2010 challenge this year and our team wants to use the light sensor to make our robot more accurate. I guess the what I mean by "program and calibrate" is program the robot to turn on the light sensor and use it. I think the problem might be in the brain of the robot because when I program the robot to go forward an unlimited amount it only goes forward 1 rotation. So really the problem is that the robot doesn't go forward an unlimited amount since the light on the sensor does turn on. But the robot doesn't stop when it gets to the black line it keeps going until it has done it's one rotation.

Re: Light sensor

Posted: 17 Nov 2010, 21:14
by mattallen37
You cannot "turn on the light sensor". You can however, control the light (for ambient vs. reflected light). It sounds like your code has issues. Again, what language are you using? I have no idea how your robot is built, or anything about your code. Perhaps if you could provide more information, we could help. The "brain" of the robot (NXT I assume), almost NEVER has problems, and almost definitely not ones that would affect anything but the screen.

Re: Light sensor

Posted: 17 Nov 2010, 21:18
by borntoown
You don't need to calibrate a light sensor in this case (even if your using the graphics software). If you put the motors to move unlimited amount in a condition, it will stop if the condition is removed (or the other way), and that what i understood from the sentence "So really the problem ... sensor does turn on". What i understood is that you didnt use the light sensor values in the program ( you just put "light sensor" and then move, i think ) so first of all , you need to know exactly what is your target. if it is to stop at the black line: move unlimited until intensity is darker than 30 (for example) and this may help you. I suppose you're using graphics software (NXT-G) so i'll say what blocks u should put if u want to do what i just said: a loop which stops with a light sensor (intensity lower than 30), and in the loop a motor block (unlimited, forward, motors (A,b,c)). I dont know what to write if you're using codes program such as NXC, im still learning it.

Hope i helped you :)

Re: Light sensor

Posted: 17 Nov 2010, 21:46
by bodybuilder09
Ok so now I can get the robot to go forward an unlimited amount but I can't get it to stop at the black line. I am using english.

Re: Light sensor

Posted: 17 Nov 2010, 22:09
by mattallen37
What I meant by language, is programming language. are you using NXT-G? NXC? ROBOTC? another? Can you share more details about the project? Can you post your code?

Re: Light sensor

Posted: 17 Nov 2010, 23:04
by bodybuilder09
We are using NXT. I have no idea what the code is that you are talking about and the project is a competition that is held every year and each year it has a theme. This years theme is biomedical engineering and in the project you have to build a robot to run a course, make a presentation based on the theme and work together to do all this. It's a challenge for middle schoolers.

Re: Light sensor

Posted: 17 Nov 2010, 23:16
by mattallen37
The "code" is your program. Can you share your program?

Re: Light sensor

Posted: 18 Nov 2010, 17:28
by afanofosc
He said this was for FLL so I think that means it has to be NXT-G. Definitely not NXC.

John Hansen