My robot program is working realy well, but only if the USB cable is connected to my Computer.
If i plug it out from the arduino the Robot do only the half of the function. In this case the servo engine dont work.
If its nesseceray i can upload also the hole code.
i fixed the problem. But its strange.
When i simulate the USB Voltage of 5V with batteries (4,5V) and use a batterie voltage of 9V for the barrel jack, everything is woking.
Its not the best solution but i have not better idea.
Is it possible that the Arduino board have a bug?
Don't forget, there is a jumper on the Motor Shield that needs to be cut if you provide a different voltage to Vin that to the barrel jack. There is discussion on this at the hardware page:
To avoid possible damage to the Arduino board on which the shield is mounted, we reccomend using an external power supply that provides a voltage between 7 and 12V. If your motor require more than 9V we recommend that you separate the power lines of the shield and the Arduino board on which the shield is mounted. This is possible by cutting the "Vin Connect" jumper placed on the back side of the shield. The absolute limit for the Vin at the screw terminals is 18V.
The power pins are as follows:
-Vin on the screw terminal block, is the input voltage to the motor connected to the shield. An external power supply connected to this pin also provide power to the Arduino board on which is mounted. By cutting the "Vin Connect" jumper you make this a dedicated power line for the motor.
-GND Ground on the screw terminal block.
The shield can supply 2 amperes per channel, for a total of 4 amperes maximum.