3 DC Motors,1 Servo, Arduino Uno, HM-10

Hi,

I am trying to get 3 bi-directional DC motors to work along with a 180 degree servo. 2 of the DC motors will steer and drive the rc car I am building. These 2 are my main concern at the moment. I am using an HM-10 Bluetooth module and a L298N motor shield (although I suspect I will eventually have to switch to an Adafruit v2, but thatā€™s neither here nor there) I have been able to connect to my bluetooth module for some time now and had it controlling my 180 degree servo before I introduced the motorshield into the equation (because servos can just be straight wired to the arduino and donā€™t require a motor shield.) Now that I am trying to get the motor shield involved Iā€™m getting nowhere. Can someone pleeeeease help me by posting their code to get one dc motor working and controlled via a button on the blynk app. I know I have it wired correctly and I also know I have bluetooth and a servo good to go. But this rc car is useless if I canā€™t actually drive it! Here is my code that currently runs 2 servos (although I will be using 1 now.)

#define BLYNK_PRINT Serial
#include <BlynkSimpleSerialBLE.h>
#include <SoftwareSerial.h>
#include <Servo.h>
SoftwareSerial SwSerial(10, 11); // RX, TX

char auth[] = ā€œd651b25ee9394d8fb295690a7317a317ā€;

Servo servo1;
Servo servo2;

BLYNK_WRITE(V5)
{
servo1.write(param.asInt());
}

BLYNK_WRITE(V6)
{
servo2.write(param.asInt());
}

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

void setup()
{
// Debug console
Serial.begin(9600);

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

Serial.println(ā€œWaiting for connectionsā€¦ā€);

servo1.attach(5);
servo2.attach(6);
}

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

//end code

Hello,

Firstly, please format all posted code as per the instructions you deleted :wink: in order to post hereā€¦ Please edit your initial post acordingly.

Also a good idea to block out part of your Auth code or someone else will be driving your servos :laughing:

Blynk - FTFC

Secondly, we help people learn about Blynk here, not hand out code on request :stuck_out_tongue_winking_eye:

That said, there is plenty of examples that others have already posted, I even have oneā€¦ so I suggest you search this forum for keywords like Car, Rover, DC motor, etc.