I have done a search on this topic and found several documents using the Sharp GP2D12 with and ADC0831. My question is it necessary to use the ADC chip when using the BS2px? I have not found any examples of using the Sharp GP2D12 as a standalone sensor. .
By default, if you connect its output to an I/O pin, there will be at certain distance at which an object trips the state of the I/O pin. If I remember correctly it will stay low until that point and then go high when something is within that range. This is just based on logic threshold.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ Chris Savage Parallax Engineering
For all intents and purposes though, the functionality of both units should be about the same when connected to an I/O pin on a microcontroller. The D15 you refer to has a fixed range at which point the I/O changes states. This is the same effect as seen by the analog output crossing the logic threshold of an I/O pin.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ Chris Savage Parallax Engineering
With the analog/D12 one can get a reading which is proportional to distance, which it seems the OP is after,·whereas·the·digital/D15·changes states·when the subject is within the threshold distance.
Using RCTIME as outllined in the referenced link ("Monitoring battery voltage with RCtime") will result in an RCTIME response value in relation to the voltage applied to the RCTIME pin, not a simple 1/0.
Comments
http://www.emesystems.com/BS2rct.htm
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Engineering
Post Edited (PJ Allen) : 9/8/2008 8:46:18 PM GMT
For all intents and purposes though, the functionality of both units should be about the same when connected to an I/O pin on a microcontroller. The D15 you refer to has a fixed range at which point the I/O changes states. This is the same effect as seen by the analog output crossing the logic threshold of an I/O pin.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Engineering
Using RCTIME as outllined in the referenced link ("Monitoring battery voltage with RCtime") will result in an RCTIME response value in relation to the voltage applied to the RCTIME pin, not a simple 1/0.