Arduino + motor shiled being controlled by BLYNK app and SC-HC-08 ble module

i wanted to make an bluetooth controlled car using the components in the title, i was wondering if the code i made would work or not, the code is supposed to controll 2 motors virtual pin one controlls the left motor/motor1 and virtual pin 2 controlls the right motor/motor2 and virtual pin 3 controlls both of the motors to go backwards if you were to drive into a wall. this is my first blynk/arduino so i expect it to have a lot of erros, if you can help me pleasee tell me how!

THE CODE -

#define BLYNK_PRINT Serial


#include <BlynkSimpleSerialBLE.h>
#include <SoftwareSerial.h>
#include <Wire.h>
#include <Adafruit_MotorShield.h>

Adafruit_MotorShield AFMS = Adafruit_MotorShield(); 
Adafruit_DCMotor *LMOTOR1 = AFMS.getMotor(1);
Adafruit_DCMotor *RMOTOR2 = AFMS.getMotor(2);



char auth[] = "e7c17d6a8ae446cab9975d01d35e46af";

SoftwareSerial SerialBLE(10, 11); // RX, TX
uint8_t i;

BLYNK_WRITE(V1)
{
   LMOTOR1->run(FORWARD);
  for (i=0; i<255; i++) {
    LMOTOR1->setSpeed(i);  
    delay(10);
  }
  for (i=255; i!=0; i--) {
    LMOTOR1->setSpeed(i);  
    delay(10);
  }
}
BLYNK_WRITE(V2)
{
  RMOTOR2->run(FORWARD);
  for (i=0; i<255; i++) {
    RMOTOR2->setSpeed(i);  
    delay(10);
  }
  for (i=255; i!=0; i--) {
    RMOTOR2->setSpeed(i);  
    delay(10);
  }
}



BLYNK_WRITE(V3)
{
  
  LMOTOR1->run(BACKWARD);
  for (i=0; i<255; i++) {
    LMOTOR1->setSpeed(i);  
    delay(10);
  }
  for (i=255; i!=0; i--) {
    LMOTOR1->setSpeed(i);  
    delay(10);
  }



  RMOTOR2->run(BACKWARD);
  for (i=0; i<255; i++) {
    RMOTOR2->setSpeed(i);  
    delay(10);
  }
  for (i=255; i!=0; i--) {
    RMOTOR2->setSpeed(i);  
    delay(10);
  }
 
    }




    
void setup()
{
  

  Serial.begin(9600);

  SerialBLE.begin(9600);
  Blynk.begin(SerialBLE, auth);

  Serial.println("Waiting for connections...");

;

}

void loop()
{
  
  Blynk.run();
}

TORTLE_TECH:
i was wondering if the code i made would work or not

You tell us. What happened when you tried it?

The best thing would be to try, it it wasn't too late in here I would have tested on my Arduino. I have already used the Blynk app and it works pretty well. You seem to have your IO already well defined so if problem there is, it shouldn't be a big one :slight_smile: