Shop OBEX P1 Docs P2 Docs Learn Events
No Subject — Parallax Forums

No Subject

eagle4ceseagle4ces Posts: 14
edited 2010-01-22 11:14 in Propeller 1
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.

Comments

  • LeonLeon Posts: 7,620
    edited 2010-01-20 21:05
    Have you looked at the Object Exchange?

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
  • JonnyMacJonnyMac Posts: 9,208
    edited 2010-01-20 21:39
    Sounds like a student putting off his homework until the last possible second, then hoping to have his work done by others. Oi....

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon McPhalen
    Hollywood, CA
  • rjo_rjo_ Posts: 1,825
    edited 2010-01-21 15:41
    Pretty nifty unit.

    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.
  • eagle4ceseagle4ces Posts: 14
    edited 2010-01-21 18:28
    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.
  • Mike GreenMike Green Posts: 23,101
    edited 2010-01-21 18:38
    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.

    www.parallax.com/tabid/442/Default.aspx
  • hover1hover1 Posts: 1,929
    edited 2010-01-21 19:31
    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 smile.gif
    Jim
    eagle4ces said...
    ·just bye the way.learnt the propeller has an internal adc wont that work.my adc didnt arrive with the order.
  • w8anw8an Posts: 176
    edited 2010-01-22 03:28
    Mike,

    When I try that page .../tabid/442/... all I get is an access denied message. And I am logged in to the site.
  • Mike GreenMike Green Posts: 23,101
    edited 2010-01-22 03:43
    The link is correct. There is some sort of problem with the website. I get the same message. Try again later.

    Here's my copy of the AN001 archive
  • w8anw8an Posts: 176
    edited 2010-01-22 05:44
    Thanks
  • eagle4ceseagle4ces Posts: 14
    edited 2010-01-22 11:14
    thanks mike ure so helpful
Sign In or Register to comment.