the following is the code i have wrote.
when i press the compilling button seems something goes wrong ...
#include <AFMotor.h>
AF_DCMotor motor1(3, MOTOR12_64KHZ);
AF_DCMotor motor2(4, MOTOR12_64KHZ);
char val;
void setup()
{
Serial.begin(9600);
motor1.setSpeed(255);
motor2.setSpeed(255);
}
void go_forward()
{
motor1.run(FORWARD);
motor2.run(FORWARD);
}
void go_reverse()
{
motor1.run(BACKWARD);
motor2.run(BACKWARD);
}
void go_left()
{
motor1.run(FORWARD);
motor2.run(BACKWARD);
}
void go_right()
{
motor1.run(BACKWARD);
motor2.run(FORWARD);
}
void stop_all action()
{
motor1.run(RELEASE);
motor2.run(RELEASE);
}
void loop()
{
if(Serial.available())
{
val = Serial.read();
if (val == 'f')
{
go_forward();
}
else if (val == 's')
{
stop_all action();
}
else if (val == 'b')
{
go_reverse();
}
else if (val == 'r')
{
go_right();
}
else if (val == 'l')
{
go_left();
}
}
}
the errors i get are the following,but why?
"sketch_sep05d:33: error: expected initializer before 'action'
sketch_sep05d.ino: In function 'void loop()':
sketch_sep05d:50: error: 'stop_all' was not declared in this scope
sketch_sep05d:50: error: expected `;' before 'action' "
PLEASE HELP!!