Arduino Code
Arduino Code
by ahmed Azouz
https://www.instructables.com/id/How-to-Make-Ardu...
*/
#include Ultrasonic.h
Ultrasonic ultrasonic(4,3);
void setup()
{
Serial.begin(9600);
delay (5000); // as per sumo compat roles
}
void loop()
{
} //--------------------------------------------
void FORWARD (int Speed){
//When we want to let Motor To move forward,
// just void this part on the loop section .
analogWrite(IN1,Speed);
analogWrite(IN2,0);
analogWrite(IN3,0);
analogWrite(IN4,Speed);
}//--------------------------------------------
void BACKWARD (int Speed){
//When we want to let Motor To move forward,
// just void this part on the loop section .
analogWrite(IN1,0);
analogWrite(IN2,Speed);
analogWrite(IN3,Speed);
analogWrite(IN4,0);
}//--------------------------------------------
void ROTATE (int Speed)
{
//When we want to let Motor To Rotate ,
// just void this part on the loop section .
analogWrite(IN1,Speed);
analogWrite(IN2,0);
analogWrite(IN3,Speed);
analogWrite(IN4,0);
}//--------------------------------------------
void Stop(){
//When we want to Motor To stop ,
// just void this part on the loop section .
analogWrite(IN1,0);
analogWrite(IN2,0);
analogWrite(IN3,0);
analogWrite(IN4,0);
}