So, i have the following code and i don't understand what seems to be the problem, i'm getting "exit status 1
'IN1' was not declared in this scope"
Does anybody know what am i doing wrong?, please help
my code is:
//Global Variables
int ENA = 4;// \
int IN1 = 2;// > LEFT MOTORS
int IN2 = 3;// /
int ENB = 7;// \
int IN3 = 5;// > RIGHT MOTORS
int IN4 = 6;// /
int velocity = 100;
void setup() {
// pinmode asignation
pinMode(ENA, OUTPUT);
pinMode(IN1, OUTPUT);
pinMode(IN2, OUTPUT);
pinMode(ENB, OUTPUT);
pinMode(IN3, OUTPUT);
pinMode(IN4, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
velocity = 100;
Forward(velocity);
delay(1000);
}
void Forward(int vel){
digitalWrite(IN1, LOW);
digitalWrite(IN2, HIGH);
analogWrite(ENA, vel); //velocity 0 - 255
digitalWrite(IN3, HIGH);
digitalWrite(IN4, LOW);
analogWrite(ENB, vel); //velocity 0 - 255
}