Society of Robots - Robot Forum

Software => Software => Topic started by: madhatter on December 09, 2008, 07:07:01 PM

Title: $50 robot GP2D15 IR Range Sensor Help
Post by: madhatter on December 09, 2008, 07:07:01 PM
Hi i have built the $50 robot and she works just like the one in the tutorial , well a little slower than that one as my wheels are tiny. I am at the stage of the build where i want to add the Sharp IR, but i have gone and got the digital GP2D15 not the GP2D12 it was last min ebay thing, I am not a programing expert more of a builder at the moment so can any one help me get this working with some code ? or  just point me in the right direction please.


(http://img99.imageshack.us/img99/4818/img0223ze3.th.jpg)[/URL]
Title: Re: $50 robot GP2D15 IR Range Sensor Help
Post by: Admin on December 13, 2008, 08:05:09 AM
Got a bigger image? :P

Read the first paragraph from here:
http://www.acroname.com/robotics/info/ideas/adjust15/adjust15.html

Quote
This sensor has a factory pre-set range of 24cm.  When an object is closer than 24cm, the digital output is high.  When an object is beyond 24cm, the digital output is low.

It doesn't actually give a range, it just tells you that an object is more or less than 24 cm away. You can still run the Stampy algorithm on it, don't worry. Open up the source code for it and look for the sharp IR threshold value. Change it to 128. And your done. ;D

If you want to do mapping, you'd need the analog Sharp IR.
Title: Re: $50 robot GP2D15 IR Range Sensor Help
Post by: madhatter on December 14, 2008, 04:34:20 PM
Thank you for your help that fixed it  ;)

(http://img233.imageshack.us/img233/2105/img0223hj8.jpg) (http://img233.imageshack.us/my.php?image=img0223hj8.jpg)
(http://img233.imageshack.us/img233/img0223hj8.jpg/1/w3072.png) (http://g.imageshack.us/img233/img0223hj8.jpg/1/)

(http://img81.imageshack.us/img81/8164/img0225of9.jpg) (http://img81.imageshack.us/my.php?image=img0225of9.jpg)
(http://img81.imageshack.us/img81/img0225of9.jpg/1/w3072.png) (http://g.imageshack.us/img81/img0225of9.jpg/1/)


Try that image i will take some new snaps and upload them soon. Once i have fixed the new servo into position.

(http://img228.imageshack.us/img228/7689/img0221ix0.jpg) (http://img228.imageshack.us/my.php?image=img0221ix0.jpg)
(http://img228.imageshack.us/img228/img0221ix0.jpg/1/w3072.png) (http://g.imageshack.us/img228/img0221ix0.jpg/1/)

This is what it looks like at the moment  ;D