Steering Movement Problem

i have made modified the circuitry

cutebuddy6:
i have made modified the circuitry

Why did you ground pin 9? That ain't gonna get you very far...

/pulling teeth, indeed! :smiley:

i have not grounded the 9th but the 8 is grounded

cutebuddy6:
i have not grounded the 9th but the 8 is grounded

My bad - was reading your schematic wrong... :slight_smile:

Still not seeing very much decoupling or common grounds.

if u can identify it with arrows or circle

dear this is the circuit thats completed and why its not working keen to know it

let me Explain you when it gets restarted/reset

when i say my steering to go Left it goes to left and when it starts to go left it restarts

and when its already left it doesnot restart

if i say it to go left and its turns the steering on left then its also get restarted

tell me please

here is the code that i am using

const int potPin = A0;

const int leftMotor = 10; //PWM pin to the L293
const int rightMotor = 9; //PWM pin to the L293

bool isLeft()          {
  return (analogRead(potPin)/4) < 14;
}
bool isLeftOfCenter()  {
  return (analogRead(potPin)/4) < 119;
}
bool isRightOfCenter() {
  return (analogRead(potPin)/4) > 133;
}
bool isRight()         {
  return (analogRead(potPin)/4) > 245;
}

void motorStop() {
  digitalWrite(leftMotor, LOW); 
  digitalWrite(rightMotor, LOW);
}
void motorLeft() {
  digitalWrite(leftMotor, HIGH);
}
void motorRight() {
  digitalWrite(rightMotor, HIGH);
}


void setup() {
  Serial.begin(115200); 
  Serial.println ("Entering setup.");
}

void loop()
{
  if (Serial.available() == 0)
    return;

  switch (toupper(Serial.read()))
  {
  case 'L':
    Serial.println("New command: L");
    if (isLeft())
      Serial.println("Already Left");
    else
    {
      Serial.println("Heading Left");
      motorLeft();
      while (!isLeft()) /* JUST WAITING */;
      motorStop();
      Serial.println("Is now Left");
    }
    break;

  case 'C':
    Serial.println("New command: C");
    if (isRightOfCenter())
    {
      Serial.println("Heading Left toward Center");
      motorLeft();
      while (isRightOfCenter()) /* JUST WAITING */;
      motorStop();
      Serial.println("Is now Centered");
    }
    else
      if (isLeftOfCenter())
      {
        Serial.println("Heading Right toward Center");
        motorRight();
        while (isLeftOfCenter()) /* JUST WAITING */;
        motorStop();
        Serial.println("Is now Centered");
      }
      else
        Serial.println("Already Centered");


    break;

  case 'R':
    Serial.println("New command: R");
    if (isRight())
      Serial.println("Already Right");
    else
    {
      Serial.println("Heading Right");
      motorRight();
      while (!isRight()) /* JUST WAITING */;
      motorStop();
      Serial.println("Is now Right");
    }

    break;

  }  // end of switch on direction

}  // end of loop

Well, the code looks good (possibly because I wrote it for you).

What does the output on Serial Monitor look like?

well its get restarted after every two command or one command i send through serial monitor

i have Posted the schematic and what if i modify the code as

void setup() {
Serial.begin(115200);
Serial.println ("Entering setup.");
pinMode(leftMotor, OUTPUT);
pinMode(rightMotor, OUTPUT);
}

cutebuddy6:
-->What will RAM do when i am Moving the code

I've been sent a personal message by CuteBuddy6 to ask for more help. Please don't.

I don't understand this sort of talk. Are you asking what the RAM will do if the buggy moves?

Oh. I see we are up to page 4.

Almost certainly the program is restarting because of electrical issues. To test disconnect the buggy and see if it restarts. The circuit you posted doesn't seem (to me) to have the Arduino in it.

You seem to be completely incapable of responding to direct questions, such as:

johnwasser:
What does the output on Serial Monitor look like?

cutebuddy6:
well its get restarted after every two command or one command i send through serial monitor

How about replying?

What Do You See In The Serial Monitor????? Copy and Paste. Don't Just Describe It.

johnwasser:
What does the output on Serial Monitor look like?

Perhaps I should rephrase that. :frowning:

cutebuddy6, please start your sketch, start the Serial Monitor, try sending the commands L, R, C, R, L, C. Then copy all the text from the Serial Monitor window and paste it into a reply here.

New command: L
Heading Left
Is now Left
New command: R
Heading Right
Is now Right
New command: C
Heading Left toward Center
Is now Centered
Entering setup.
New command: L
Heading Left
Is now Left
New command: R
Heading Right
Is now Right
Entering setup.
New command: C
Heading Left toward Center
Is now Centered
New command: L
Heading Left
Is now Left
New command: R
Heading Right
Is now Right
Entering setup.
New command: L
Heading Left
Is now Left
New command: C
Heading Right toward Center
Is now Centered
Entering setup.

here is what i get on serial Monitor

cutebuddy6:
New command: L - Heading Left - Is now Left
New command: R - Heading Right - Is now Right
New command: C - Heading Left toward Center - Is now Centered
Entering setup.

New command: L - Heading Left - Is now Left
New command: R - Heading Right - Is now Right
Entering setup.

New command: C - Heading Left toward Center - Is now Centered
New command: L - Heading Left - Is now Left
New command: R - Heading Right - Is now Right
Entering setup.

New command: L - Heading Left - Is now Left
New command: C - Heading Right toward Center - Is now Centered
Entering setup.

So it has nothing to do with going Left specifically because it happens randomly after L, R, or C. It has nothing to do the motors running because it only happens AFTER the message that gets sent AFTER the motors have been stopped.

If it were a real Arduino there could be the possibility that the PC is glitching the DTR signal for some reason and the auto-reset is happening between commands. To test for that you could jumper the Reset pin to +5 and see if the symptom goes away. Since you have built your own Arduino-like circuit and have not shown it I don't know if you implemented auto-reset or not.

It just worked
I followed the link given by the member and it just worked
http://arduino.cc/forum/index.php/topic,91456.0.html

I'd like to refer you to reply #41

Thank you all of you in helping me out thanks