So, when there is nothing in front of the bot, a +5V logic voltage is applied on VOUT and when something is detected by the photodiode, the voltage step down to 0V.
My problem is that I don’t know which command I’m to use with my Basic ATOM 28 so the voltage drop will be detected.
Previously, I was using a simpler detector that supplied a +5V voltage when triggered and using this code :
delay var byte
rate var byte
count1 var byte
delay=40
rate=80
testloop
high P15
button P14,0,delay,rate,count1,1,turnleft
low P15
goto testloop
But, when I try to change the normal state of the pin, it doesn’t work. (Either it go backward and turn left permanently detecting something or it goes always forward never detecting anything).
So, is there any other simpler command to use (like detecting a dropping voltage) ?
If it is simply detecting +5v and 0V then this is a simple TTL input, so assuming you are connect to pin P0, you could do something like:
input p0
loop:
if in0 then
; do the +5v stuff
else
; do the 0v stuff
endif
...
goto loop
If the output is variable between 0-5v you can use the AtoD converter:
word w
w wVolts
...
w = adin p0
; w is in the range 0-1023 so to convert w to 1/10s of volt you could do something like
wVolts = (w * 5 * 10)/1024 ; multiply by 5v and 10 to get 10s of degree (could do 100 but not in word...)
; do comparisons for different voltages...
Do you want to mean a picture ? I will do it tomorrow.
Yes, I plugged the Vout in the AX0 pin of my mini-ABB and used the adin command.
My quad is the ancient model (no longer in production) of Lynxmotion, the yellow lexan one. :mrgreen:
I named him John Henry as a wink to the Sarah Connor’s Chronicle series.
Here is a video with his new IRPD and new walking gait :
I did an experiment with IR detection and it worked ok but it had some limitations on the type of surfaces and objects it was able to see. Flat walls were ideal but the legs of chairs, the thin edge of a book shelf, or anything below the eye level gave shaky results.
Hi Mike,
Nice video. One thing I found when I was playing with the IR sensor on my Rover I had much better luck finding smaller things when it was vertical and not horizontal. Robot Dude confirmed that they found that as well when they were doing the seek and destroy as he mentioned in the thread: viewtopic.php?f=9&t=4875&start=75
Of course his eyes may look a bit strange if they were vertical.
I remember that post. I’m not using the Sharp GP2D12 IR Sensor in this case though, instead I am using the Panisonic IR module and IR emitter. Perhaps you were talking about moving these components in a verticle fashion, in which case it would look funny. I can increase the detectablility by using a lower value resistor so that the IR is brighter but it can only go so bright before it burns out.
I ment to say in the previous post that the ADin feature of the BAP is one of my favorite features. I wanted to make that point but forgot. The ADin allows my IR wiring harness to plug right in and function.