DC motor Steering control through POT

can i write

while(center=true)

You just did.
It will compile, but it will not do what you think it will, because it is an assignment, and not a comparison

No. That assigns true to center. It doesn't test anything.

Look, stop right there. Put the resistors on the LEDs or take them out. Post a PHOTO, not a diagram. Stop ignoring all the suggestions we make.

Disconnect everything except the Pot. Show a photo to prove it, like this:

Run this sketch:

void setup ()
{
  Serial.begin (115200);
}

void loop ()
{
  int aval = analogRead (A0);
  Serial.println (aval);
  delay (500);
}

Show your output. Mine was:

716
716
893
947
947
946
944
943
855
835
811
726
544
384
326
289
271
270
269
270
269
270
270
270
270
270
270
270

The numbers only change when I turn the knob.

these are the Photos and the code that i am running is posted above ok

What's that thing labelled "Heavy Duty"?

I don't see any resistors. How many times, I ask myself?

Look, without resistors the LEDs will overload the processor. It will MALFUNCTION.

So put the resistors in series with the LEDs and then complain if it doesn't work.

Battery

well Mr. Nick Resistor are very necessary i realize that but what i am still concern is about my Program code. the Problem that, i am in is know i have to send L two times first time to check if its in the Left Position or not if not then move the POT and then send L again for a check

Well Mr cutebuddy6, you realize it's very necessary, but you aren't planning to put them in, is that it?

:wink: ya i am a looser in Programming guide me with the Problem please

You've been given a lot of advice on this thread, much of which you have chosen to ignore.
Why should we continue to waste our time trying to help you, if you won't help yourself?

This is now the longest thread on the Programming Questions forum.

Why do you have to enter stuff twice? Maybe because the processor is resetting?

dxw00d:
This is now the longest thread on the Programming Questions forum.

That's because he is totally ignoring our suggestions, but keeping on asking for help on solving the Problem.

i am not ignoring any suggestion =(. please my code is working fine its just that Problem that i have to send the case two times and how can i make it send one time and complete that case :~

Is, as has been suggested, your processor resetting?
You'd know this, if you'd followed the suggestion to label your prints.
What is the battery thing doing in your circuit?

battery is the thing Else i am using the 5V adapter how can i know that my Arduino is resetting

By putting prints at significant points in your code, like in setup.

How sir Are you talking about Serial.print() or else

println, by preference, but yes.