// declare your variables here
const int motor1f = 2;
const int motor1r = 3;
const int motor2f = 4;
const int motor2r = 5;
int speedcontrol1 = 6;
int speedcontrol2 = 11;
char val. // this is for bluetooth
void setup(){
pinMode(motor1f, OUTPUT);
pinMode(motor1r, OUTPUT);
pinMode(motor2f, OUTPUT);
pinMode(motor2r, OUTPUT);
pinMode(speedcontrol1, OUTPUT);
pinMode(speedcontrol2, OUTPUT);
Serial.begin(9600); //
// write your setup here.
// declare whether it is an INPUT or OUTPUT
}
void loop(){
while (Serial available() > 0) // this is for bluetooth
{
val Serial read(); // this is for bluetooth
Serial.printin(val), // gei the sent data of Bluetooth app va saral monitor
}
if (val == 'F'){
digitalWrite(motor1f, HIGH);
digitalWrite(motor2f, HIGH);
} // replace the question mark by the character
//DO SOMETHING
else if (val == 'S'){ // replace the question mark by the character
digitalWrite(motor1f, LOW);
digitalWrite(motor2f, LOW);
//DO SOMETHING
}
if (val == 'B'){
digitalWrite(motor1r, HIGH);
digitalWrite(motor2r, HIGH);
} // replace the question mark by the character
//DO SOMETHING
else if (val == 'S'){ // replace the question mark by the character
digitalWrite(motor1r, LOW);
digitalWrite(motor2r, LOW);
//DO SOMETHING
}
if (val == 'L'){
digitalWrite(motor1f, HIGH);
digitalWrite(motor2r, HIGH);
} // replace the question mark by the character
//DO SOMETHING
else if (val == 'S'){ // replace the question mark by the character
digitalWrite(motor1f, LOW);
digitalWrite(motor2r, LOW);
//DO SOMETHING
}if (val == 'R'){
digitalWrite(motor1r, HIGH);
digitalWrite(motor2f, HIGH);
} // replace the question mark by the character
//DO SOMETHING
else if (val == 'S'){ // replace the question mark by the character
digitalWrite(motor1r, LOW);
digitalWrite(motor2f, LOW);
//DO SOMETHING
}
}