PROGRAM FOR AN OBSTACLE SENSING ROBOT

Hi,

I'm new to arduino and the programming part, but due to my interest in robotics i have now built an obstacle sensing robot using an arduino with an ATMEGA128 chip in it, i have used an ir sensor, and a motor driver with L293DNE, and my robot has 2 stepper motors. i have no servo for my robot

i have connected my arduino to my computer and i've tried many basic programs such as blink and fade and it all works perfectly.

now after connecting all the parts, i'm in need of a program to run my robot such that when my robot senses an obstacle it should stop moving and then turn and take another route and continue the same way.

since this is my first venture into arduino and robots, i thought i'll start from the basic

please can some one help me, by building a code for me so as to run the robot. i would be really very thankful and grateful if someone could help me by doing the needful

Have you written a sketch that will read an ir sensor? Have you written one to move a stepper? Both of those you can probably find examples for, and by tweaking them you can start learning how to program.

Also, please fix your capslock key -- it's a little hard to read.

Without knowing how your hardware is wired, or how your robot is driven, it would be hard to offer anything but vague advice.

Please don't shout - you can go back to your post, click on "modify" and retype it, then click on "save".

My eyes! Arrrrgggghhhh!

Amend the post into normal capitalization please.

Rduino: NOW AFTER CONNECTING ALL THE PARTS, I'M IN NEED OF A PROGRAM TO RUN MY ROBOT SUCH THAT WHEN MY ROBOT SENSES AN OBSTACLE IT SHOULD STOP MOVING AND THEN TURN AND TAKE ANOTHER ROUTE AND CONTINUE THE SAME WAY.

If you want somebody to write the sketch for you, you should post this under gigs and collaborations. I hope that you'll be brave enough to have a stab at it yourself, though.

To start with I suggest you write test sketches for each bit of hardware that you need to interact with that just shows how to interact with that bit - how to read from the sensor and show you're getting sensible values; how to move the motors to a certain position or at a certain speed.

Once you have the basics in place you also need to figure out what algorithm you're going to use to avoid obstacles. This isn't really a programming problem - you need to be able to produce a description of what the 'bot will do in terms of the sensor inputs and motor outputs. Then you need to implement that algorithm in code, which is likely to be the hardest part, but there'll be plenty of people here willing to help you. You need to have done the groundwork yourself first, though.

Sorry guys, i have fixed the capitals now...

now after connecting all the parts, i'm in need of a program to run my robot such that when my robot senses an obstacle it should stop moving and then turn and take another route and continue the same way.

If you have really understood the stuff that you have done so far, this really should be fairly easy. You will learn a lot more doing it yourself.

Write a sketch that "senses an obstacle". Toggle an LED when that happens. Exact details on how to do this are not possible, because we have no idea which IR sensor you have. Nor do we have any idea how close to the obstacle is too close. Finally, we have no idea how you have connected it to the Arduino.

Write another sketch that simply makes the robot move forward. After 2 seconds, make the robot stop. After another second, make the robot back up. After some time, turn left, After some time, turn right.

You will learn a lot doing this, about things like speed and torque, slippage, acceleration, etc.

You'll learn just how difficult it is, without feedback, to consistently make a 90 degree left turn and a 90 degree right turn. You'll learn just how difficult it is to make the robot make 3 such turns to go around an obstacle and continue on the original course.

You'll learn just how difficult it is to simply travel in a straight line.