Coding a robot with a GP2Y0A02YK sharp infrared range finding sensor [Picaxe Board] - Printable Version +- Support Forums (https://www.supportforums.net) +-- Forum: Categories (https://www.supportforums.net/forumdisplay.php?fid=87) +--- Forum: Life Support (https://www.supportforums.net/forumdisplay.php?fid=12) +---- Forum: Omni's Secret Hidden Inside Tricks (https://www.supportforums.net/forumdisplay.php?fid=13) +---- Thread: Coding a robot with a GP2Y0A02YK sharp infrared range finding sensor [Picaxe Board] (/showthread.php?tid=16455) |
Coding a robot with a GP2Y0A02YK sharp infrared range finding sensor [Picaxe Board] - Tate - 02-25-2011 I'm going to be coding a robot that will seek adventure. I've recently gotten into robotics, and this should be a fairly simple task. The GP2Y0A02YK range finder will send off an infrared light and look for it's reflection. It then calculates the time it takes to see a reflection and finds the distance my robot is from an object. I will then use a programming language called Picaxe to control my circuit board so that when it gets within a few feet of an object, it will look left and log the distance from the next object in sight, and then look right and do the same. It will then turn itself and go towards the area where the next object is the farthest away. I'm going to be using a Picaxe project board, which will allow me to manuever everything with a microproccessor which I can code to with picaxe. I already have a cable for coding with Picaxe from a past project. Here's a picture of the Picaxe project board which can be bought for $20 online:
For only $14.50, here's the sensor I'm using:
If you want to do your own, here's a Picaxe source. This was originally intended to just turn itself around and randomly move in another direction when in contact with an object, but I modified it do do what I needed. You're going to need to learn a little picaxe before understanding it. It's not really too similar to any popular languages. I would compare it to visual basic more than anything else (due to it's horrifying [yet popular] syntax). Picaxe Code: PHP Code: Symbol dangerlevel = 70 RE: Coding a robot with a GP2Y0A02YK sharp infrared range finding sensor [Picaxe Board] - Omniscient - 02-25-2011 http://www.rev-ed.co.uk/picaxe/ Some interesting stuff to read about. RE: Coding a robot with a GP2Y0A02YK sharp infrared range finding sensor [Picaxe Board] - Tate - 02-26-2011 (02-25-2011, 11:49 PM)Omniscient Wrote: http://www.rev-ed.co.uk/picaxe/ Indeed. Particularly here: http://www.techsupplies.co.uk/AXE020 And Picaxe Information->Basic Commands. |