Hey gang,
It's been a hot minute since I've posted here so I'm trying to knock the dust off. On a product I snagged, the distance sensor in the title of this post, I can't seem to find a guide on using it? What library/etc. and the guides are always such a useful help for me as a mostly visual person, so being able to see the whole picture first is great. Does one exist and I'm just missing it? The first time I tried to get one of these to work I couldn't, but that was over a year ago so the details of that adventure are foggy.
Thanks in advance!
learning guide for Sharp GP2Y0D805Z0F Digital Distance Senso
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- burrito_poots
- Posts: 134
- Joined: Thu May 30, 2019 5:02 pm
- dastels
- Posts: 15608
- Joined: Tue Oct 20, 2015 3:22 pm
Re: learning guide for Sharp GP2Y0D805Z0F Digital Distance S
There doesn't seem to be a guide, but it's really simple to use. Look at the specs and schematic on the product page https://www.adafruit.com/product/3025 it appears to take gnd, Vcc, and provide a logic output (low when it detects something, high otherwise). So hook up power and connect its output to a digital input. So there's no library needed other than digital I/O support.
Dave
Dave
- adafruit_support_bill
- Posts: 88037
- Joined: Sat Feb 07, 2009 10:11 am
Re: learning guide for Sharp GP2Y0D805Z0F Digital Distance S
I've use these sensors and there really isn't much to them. The output signal goes HIGH when the target is in range and LOW when not.
The pins are labeled on the back of the board. You just need GND, VIN (it will work with either 3.3v or 5v) and connect 'Out' to a digital pin on your processor.
The pins are labeled on the back of the board. You just need GND, VIN (it will work with either 3.3v or 5v) and connect 'Out' to a digital pin on your processor.
- burrito_poots
- Posts: 134
- Joined: Thu May 30, 2019 5:02 pm
Re: learning guide for Sharp GP2Y0D805Z0F Digital Distance S
Do you guys happen to know of any coding projects that use this so I can look at some example code? It's been a long time and I haven't set up a simpler sensor like this that didn't require a library. Very much a copy/paste/edit where needed coder at this stage so it helps greatly :)
- adafruit_support_bill
- Posts: 88037
- Joined: Sat Feb 07, 2009 10:11 am
Re: learning guide for Sharp GP2Y0D805Z0F Digital Distance S
It is pretty much like any other digital input signal. The result of a digitalRead is either HIGH or LOW:
The only difference between these and a pushbutton switch is that you don't need the pinMode(buttonBpin, INPUT_PULLUP);
https://learn.adafruit.com/adafruit-ard ... duino-code
The only difference between these and a pushbutton switch is that you don't need the pinMode(buttonBpin, INPUT_PULLUP);
https://learn.adafruit.com/adafruit-ard ... duino-code
- burrito_poots
- Posts: 134
- Joined: Thu May 30, 2019 5:02 pm
Re: learning guide for Sharp GP2Y0D805Z0F Digital Distance S
Is there a circuit python equivalent you would recommend bill?adafruit_support_bill wrote:It is pretty much like any other digital input signal. The result of a digitalRead is either HIGH or LOW:
The only difference between these and a pushbutton switch is that you don't need the pinMode(buttonBpin, INPUT_PULLUP);
https://learn.adafruit.com/adafruit-ard ... duino-code
- adafruit_support_bill
- Posts: 88037
- Joined: Sat Feb 07, 2009 10:11 am
Re: learning guide for Sharp GP2Y0D805Z0F Digital Distance S
Tony has a tutorial on CircuitPython digital inputs here: https://learn.adafruit.com/circuitpytho ... tal-inputs
Please be positive and constructive with your questions and comments.