Shop OBEX P1 Docs P2 Docs Learn Events
No Pbasic code for the Sony IR sensor? — Parallax Forums

No Pbasic code for the Sony IR sensor?

Hello, I purchased the dual ultrasonic and Sony IR sensor for my Arlo project with your BS2 board of education. However, there is no code example in P Basic . Do you have to use the spin or C platform for the Sony sensor? GP2Y0A02YK0F IR Distance Sensor (#28997)

Comments

  • I'm pretty sure the "GP2Y0A02YK0F" sensor outputs an analog voltage signal. You'll need and analog to digital converter chip to monitor the voltage. Alternatively, you could use something like RCTIME.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    As Duane mentioned, you would just use PBASIC code for whatever ADC you're using and then you can translate that value to the distance using math. Too many variations of the Sharp sensors and too many ADC choices to have example code for them all.
  • ercoerco Posts: 20,254
    The old Parallax PDF attached is worth its weight in gold. It teaches about the ADC0831 and the Sharp sensor AND provides the PBASIC code. I don't think it's anywhere on their web site anymore, which is utterly ridiculous. You aren't the first person to request it recently. I downloaded it a while ago from a third party website and saved it for a moment such as this.

    C'mon Parallax, put this back on your site! There's Propeller code but no PBASIC on the product page: https://www.parallax.com/product/28995

    Yes the sensor has changed slightly (old GP2D12, new GP2Y0A21YK0F) but they are pretty much identical and interchangeable. At least host the old document until you update it with the new part number. It's a win-win.

    Wim with Jim. (Obscure CHEERS reference)
Sign In or Register to comment.