Light sensor

Discussion specific to the intelligent brick, sensors, motors, and more.
bodybuilder09
Posts: 4
Joined: 17 Nov 2010, 16:41

Light sensor

Post 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.
mattallen37
Posts: 1818
Joined: 02 Oct 2010, 02:19
Location: Michigan USA
Contact:

Re: Light sensor

Post 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).
Matt
http://mattallen37.wordpress.com/

I'm all for gun control... that's why I use both hands when shooting ;)
bodybuilder09
Posts: 4
Joined: 17 Nov 2010, 16:41

Re: Light sensor

Post 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.
mattallen37
Posts: 1818
Joined: 02 Oct 2010, 02:19
Location: Michigan USA
Contact:

Re: Light sensor

Post 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.
Matt
http://mattallen37.wordpress.com/

I'm all for gun control... that's why I use both hands when shooting ;)
borntoown
Posts: 58
Joined: 14 Nov 2010, 16:58

Re: Light sensor

Post 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 :)
B2O productions are the best for the best.
bodybuilder09
Posts: 4
Joined: 17 Nov 2010, 16:41

Re: Light sensor

Post 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.
mattallen37
Posts: 1818
Joined: 02 Oct 2010, 02:19
Location: Michigan USA
Contact:

Re: Light sensor

Post 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?
Matt
http://mattallen37.wordpress.com/

I'm all for gun control... that's why I use both hands when shooting ;)
bodybuilder09
Posts: 4
Joined: 17 Nov 2010, 16:41

Re: Light sensor

Post 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.
mattallen37
Posts: 1818
Joined: 02 Oct 2010, 02:19
Location: Michigan USA
Contact:

Re: Light sensor

Post by mattallen37 »

The "code" is your program. Can you share your program?
Matt
http://mattallen37.wordpress.com/

I'm all for gun control... that's why I use both hands when shooting ;)
afanofosc
Site Admin
Posts: 1256
Joined: 26 Sep 2010, 19:36
Location: Nashville, TN
Contact:

Re: Light sensor

Post by afanofosc »

He said this was for FLL so I think that means it has to be NXT-G. Definitely not NXC.

John Hansen
Multi-platform LEGO MINDSTORMS programming
http://bricxcc.sourceforge.net/
Post Reply

Who is online

Users browsing this forum: Semrush [Bot] and 11 guests