greating this is a simple program for control 4wd car (dc motors)
but have error i anyones want to give a advice thanks a lot....
exit status 1
'Motor1' was not declared in this scope
#include <AFMotor.h>
AF_DCMotor g_motor1(1, MOTOR12_8KHZ); // back left
AF_DCMotor g_motor2(2, MOTOR12_8KHZ); // back right
AF_DCMotor g_motor3(3, MOTOR12_8KHZ); // front right
AF_DCMotor g_motor4(4, MOTOR12_8KHZ); // front left
void setup()
{
}
void loop()
{
Motor1.setSpeed(255);
//exit status 1
'Motor1' was not declared in this scope
Motor2.setSpeed(255);
Motor3.setSpeed(255);
Motor4.setSpeed(255);
Motor1.run(FORWARD);
Motor2.run(FORWARD);
Motor3.run(FORWARD);
Motor4.run(FORWARD);
delay(1000);
Motor1.run(BACKWARD);
Motor2.run(BACKWARD);
Motor3.run(BACKWARD);
Motor4.run(BACKWARD);
delay(1000);
Motor1.run(FORWARD);
Motor2.run(BACKWARD);
Motor3.run(BACKWARD);
Motor4.run(FORWARD);
delay(1000);
Motor1.run(BACKWARD);
Motor2.run(FORWARD);
Motor3.run(FORWARD);
Motor4.run(BACKWARD);
delay(1000);
Motor1.setSpeed(0);
Motor2.setSpeed(0);
Motor3.setSpeed(0);
Motor4.setSpeed(0);
Motor1.run(BRAKE);
Motor2.run(BRAKE);
Motor3.run(BRAKE);
Motor4.run(BRAKE);
delay(1000);
}