runSpeed);
digitalWrite(Left_Dir_Pin, LOW); digitalWrite(Right_Dir_Pin, LOW); digitalWrite(Left_Go_Pin, HIGH);
digitalWrite(Right_Go_Pin, HIGH);
}
Создаём
блоки для передвижений робота
void goRevers() //движение назад
{
stop();
analogWrite(Left_Speed_Pin, runSpeed);
analogWrite(Right_Speed_Pin, runSpeed);
digitalWrite(Left_Dir_Pin, HIGH);
digitalWrite(Right_Dir_Pin, HIGH);
digitalWrite(Left_Go_Pin, LOW);
digitalWrite(Right_Go_Pin, LOW);
delay(350);
}
void turnRight() //разворот вправо
{
stop();
analogWrite(Left_Speed_Pin, runSpeed);
analogWrite(Right_Speed_Pin, runSpeed);
digitalWrite(Left_Dir_Pin, LOW);
digitalWrite(Right_Dir_Pin, HIGH);
digitalWrite(Left_Go_Pin, LOW);
digitalWrite(Right_Go_Pin, HIGH);
delay(700);
}
void turnLeft() //разворот влево
{
stop();
analogWrite(Left_Speed_Pin, runSpeed);
analogWrite(Right_Speed_Pin, runSpeed);
digitalWrite(Left_Dir_Pin, HIGH);
digitalWrite(Right_Dir_Pin, LOW);
digitalWrite(Left_Go_Pin, HIGH);
digitalWrite(Right_Go_Pin, LOW);
delay(700);
}