Hi and thanks for your follow up
1- I don't know how to post the code in the code tag. please teach me if necessary
2- how should I comment out the test section rather than deleting it?
3- My OS is windows XP professional second edition and the version of IDE that I use is 1.6.12
4- I disconnect the pin 0 and 1 any time I compile or upload the code
5- I tested to see what the problem is compiling the code after deleting the testing part is, so I deleted line by line and I saw when I delete the first delay, the compiling is failed. I hereby send you the last code I have that not only compiled and upload but stopped testing, so you can see what the problem was.
5-1) void setup()
{
// sets the pins as outputs:
pinMode(motorPin1, OUTPUT);
pinMode(motorPin2, OUTPUT);
pinMode(enablePin, OUTPUT);
// sets enablePin high so that motor can turn on:
digitalWrite(enablePin, HIGH);
// initialize serial communication at 9600 bits per second:
Serial.begin(9600);
delay(200);
}
NOTE: THE COMPILING FAILS IF I DELETE "delay(200);"
6- The final question is, printing the log for each function is too long, for example, the IDE serial monitor shows below lines each time the function is done.
State : 1
in motorRight()
Called from : state 1
timing
Motor: right
in motorStop()
Called from : timing ended
So, may you teach me how I can short it, for example for state 1, the serial print just print "Right"
Regards