Help regarding the code

Hello, I'm Jay (age:13) and I;m trying to make an object avoiding robot with an arduino UNO. The components I've used are: 2 motors, motor shield, IR sensors and a chassis from robo India. However, I've been facing some problems with my code.

A little help will be appreciated.

unobot.zip (2.79 KB)

unobot.zip (2.79 KB)

Your code is very incomplete. and both attachments seem to be the same ?

I've been facing some problems

And they are. . ?

All the codes in the attachments are same, actually, I tried to compile the code from several other websites (and the I did some editing) because I couldn't find the required sketch. As I'm a total newbie I accept I would have done some mistakes, could you help me rectify those?

Thank you in advance.

MEjay:
All the codes in the attachments are same, actually, I tried to compile the code from several other websites (and the I did some editing) because I couldn't find the required sketch. As I'm a total newbie I accept I would have done some mistakes, could you help me rectify those?

Thank you in advance.

Fix everything for you?

You learn by doing, not by having someone do you work.
At 13, it is time you learn this.

I can understand ieee48, but as i said I'm a total newbie, I've been spending a lot of time on the project. And I practically don't know the arduino coding language, so a little help would do no harm.

Anyway, I've not asked you to write the WHOLE sketch, it would be nice if you helped me with the wrong part.

MEjay:
I'm a total newbie,

And I practically don't know the arduino coding language,

Then start with something a lot less complicated than an obstacle avoiding robot.

There are lots of short example programs that come with the Arduino IDE which will cover many (maybe all) of the techniques you will need for your robot. Study them and that should help you become familiar with the language.

A great deal of what you need to know to write any successful program has very little to do with the programming language and mostly to do with understanding in detail what needs to happen.

...R
Planning and Implementing a Program

MEjay:
Anyway, I've not asked you to write the WHOLE sketch, it would be nice if you helped me with the wrong part.

Start small and learn.

A robot isn't good for a beginner.

I am not going to spend my time fixing a sketch for which I don't have the hardware.

I'm not such a beginner, I already know how to blink LED's, also I can make my robot to do small functions and even functions like following a line.
On the internet you can find results for 'object avoiding robot with IR sensors', but almost all of the don't include the motor shield in it for which you need a separate code and that's what is troubling me the most.
I've always learnt that mistakes help you grow, and if you decide to help me on this one, it might teach me a LOT.
(And by-the-way, I have all the hardware assembled, just the code remains.)

What I meant was I have not studied the language so thoroughly, not that I didn't know the whole language.

MEjay:
I'm not such a beginner,

Your Original Post said you are - hence my response.

also I can make my robot to do small functions and even functions like following a line.
On the internet you can find results for 'object avoiding robot with IR sensors', but almost all of the don't include the motor shield

So how are you controlling the motors in the robot that is working - if not with a motor shield?

If you already have a working program that you are trying to extend then please post the program and tell us what you want to add to it

...R