please i have a project to submit next week.can i get an object to to measure distance using the gp2d12 sharp infrared sensor. or a tutorial on how to use the counter for analog to digital converter.
The unit outputs a voltage measurement which is roughly the result of a trig function of the distance to the object. Because the unit only measures within a specified distance range, you could make a look-up table of measured voltages and distances and simply use linear interpolation between known values. The accuracy would be limited by the number of bits in your a/d and the size of your look up table.
You could also use a little trig and figure out the exact values for the angle of the first lens, and the space between pixels on the ccd.
You first need to do a/d on the voltage output from the unit... to read the voltages... Go to the OBEX and pick an A/D solution. Then you need to do a little math or construct a lookup table, which converts your measured voltages measurements into distances, which you might find in the documentation or have to create yourself. You will be working between about 2.6 V max and 0.4 V min. Either an 8 or 12 bit A/D ought to get you where you are trying to go.
is not a class project is for a fair am pataking.its takes a long time to get things down hear inafrica ghana. just bye the way.learnt the propeller has an internal adc wont that work.my adc didnt arrive with the order.
There's an application note (AN001) for the Propeller downloadable from the Propeller Downloads webpage. This includes documentation on the cog counters including their use to make an ADC. It includes sample code and the object to do the ADC.
You might have been reading about the Prop II internal ADC. That won't be available next week, or next month. Maybe next year.
How about adding a subject line. It's the right thing to do
Jim
eagle4ces said... ·just bye the way.learnt the propeller has an internal adc wont that work.my adc didnt arrive with the order.
Comments
Leon
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Amateur radio callsign: G1HSM
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon McPhalen
Hollywood, CA
Take a look here: http://www.acroname.com/robotics/info/articles/sharp/sharp.html#e5
The unit outputs a voltage measurement which is roughly the result of a trig function of the distance to the object. Because the unit only measures within a specified distance range, you could make a look-up table of measured voltages and distances and simply use linear interpolation between known values. The accuracy would be limited by the number of bits in your a/d and the size of your look up table.
You could also use a little trig and figure out the exact values for the angle of the first lens, and the space between pixels on the ccd.
You first need to do a/d on the voltage output from the unit... to read the voltages... Go to the OBEX and pick an A/D solution. Then you need to do a little math or construct a lookup table, which converts your measured voltages measurements into distances, which you might find in the documentation or have to create yourself. You will be working between about 2.6 V max and 0.4 V min. Either an 8 or 12 bit A/D ought to get you where you are trying to go.
www.parallax.com/tabid/442/Default.aspx
How about adding a subject line. It's the right thing to do
Jim
When I try that page .../tabid/442/... all I get is an access denied message. And I am logged in to the site.
Here's my copy of the AN001 archive