-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using IR Sensors #10
Comments
My problems were because something is backwards here for the IR sensors only. When I use this example code: #-------------------------------# This code would only enter the IF statement when there was NOT an obstruction, which was causing me misery when I kept putting something in front of the sensor, and it would never enter the IF statement. I had to rewrite the code to follow this form: #-------------------------------# PiMotor.py has an IR pin voltage backwards (checking for pin voltage up when they mean down or vice versa) but I don't know how to fix it. This also applies to IR2 input. If you just want a piece of code as an example. Here is a very unfinished, untested, (and poorly written) chunk of something I am preparing for some kids to demonstrate a little tank navigating a simple maze. You might want to take a look if you want to see the indents, since this editor is not saving my indentations above which Python requires. |
Hi, I hope this helps? |
Hello,
I bought an analog IR distance sensor (https://www.robotshop.com/en/sharp-gp2y0a21yk0f-ir-range-sensor.html) and wanted to test it on the motor-shield. I've connected VCC to +, GND to -, and V0 to OP on the board. Running the provided test program there seems to be no reaction, IR is never triggered.
Tested on both IR connectors. I'm pretty new to all of this so I guess I'm missing something very basic. Thanks for any help, people!
The text was updated successfully, but these errors were encountered: