Infrared sensor
Robot Freak
Posts: 168
I've found a infrared example on the Yahoo group, but it also sends infrared with an transmitter.
I don't need that, because i'm using an infraredball, but I can't find the correct things to delete...
Isn't there a simple way like CPU.readport() or something?
Thanks!
Post Edited (Robot Freak) : 12/11/2006 7:57:14 PM GMT
I don't need that, because i'm using an infraredball, but I can't find the correct things to delete...
Isn't there a simple way like CPU.readport() or something?
Thanks!
Post Edited (Robot Freak) : 12/11/2006 7:57:14 PM GMT
Comments
I'm using the IR receiver from parallax:
www.parallax.com/detail.asp?product_id=350-00014
Post Edited (Robot Freak) : 12/13/2006 8:46:27 PM GMT
a low signal when it detects a 40kHz infrared signal.
So you can use CPU.readPin() to test wether you get
a low or high signal.
To decode a pulsetrain requires more info.
What program did you find at the yahoo group?
Please attach it to your post.
regards peter
IrRangeSensorTest1
IrRangeTest1
And packages:
IrRangeDropOffSensor
IrRangeSensor
IrRangeSensorTask
But they all work with a transmitter (I think)
the intensity of a led and so are able to measure distance.
With an independant light source you cannot measure distance
but you can detect light.
The only statement from those programs that applies to detecting light
is
····· if(!CPU.readPin(detectorPin)) {
······· //light detected
····· }
····· else {
······· //light not detected
····· }
You might want to try using
· int time = CPU.pulseIn(32767,detectorPin,false);
which measures a low going pulse in 8.68usec units
regards peter
·