I’m having trouble controlling my dc motor from my phone. I can control a servo just fine, but the dc motor will not spin. I am using an Arduino Uno, Adafruit v2 motorshield, and HM-10 Bluetooth module. I know it has to be the code that is wrong since I have everything wired properly and that I can control a servo which proves that the communication between my phone and Bluetooth works fine. If anyone can help narrow down what might be wrong with my code that would be great. Thanks!
As per the directions you deleted in order to post this… I fixed your posted code formatting
This is not really a code fixit shop but have you tested those motor commands without Blynk… say using a loop or physical button to process a similar type of function?
Do you even have the Motor Shield configured properly???
And how can you use the same pins for two serial devices?
I think your issues are totally non-Blynk related… get it working without Blynk first, then add in the Blynk control of the tested and working functions.
I have yet to get the motors to work any other way other than connecting them to the breadboard, which makes them rotate. I’ve watched a lot of tutorial videos and researched how to set up the Adafruit, and I think that is fine. The soldered connections are fine and the power light is on. I am able to control a servo from the motorshield as well so I figure it must come down to the coding for the dc motors.
I deleted the SoftwareSerial SwSerial(10,11) in the code as well. I have my Bluetooth module connected to the 10 and 11 pins. What else could I do? I think other parts of the code look fine what say you?
As your issue is not directly Blynk related (Blynk can’t “control” that shield, the associated library does), I think I have already made a valid suggestion
PS Servo and DC motor control are totally separate functions… even if on the same shield.
Add details :
• Hardware model + communication type. For example: Arduino UNO with Ethernet Shield
• Smartphone OS (iOS or Android) + version
• Blynk server or local server
• Blynk Library version
• Add your sketch code. Code should be formatted as example below.
Simply paste your code between ``` If you don’t format your code, your topic can be deleted by moderators.
Ok, so I am trying to create a little vehicle. 2 dc motors will drive the vehicle. 1 dc motor will engage a conveyor belt system and a servo will be used to raise and lower the conveyor belt system. I have connected to my HM-10 Bluetooth module from my phone and have been able to control the servo with it. I am having trouble controlling the dc motors that are connected to an Adafruit v2.3 motorshield. The dc motors spin when I upload a test code that varies their speed and direction, but I can’t control them with my phone. Take a look at my code and see if there’s anything wrong in there. I’m confident that my wiring is done correctly. At this point, I’m just not sure what’s wrong with it but it has to be Blynk related (or so I am thinking) or the code associated with it. Any advice would be great thanks!
I added the few parts to my code from the example that you linked me to and still not working. Also, now I have both SoftwareSerial SwSerial(10,11) and SoftwareSerial SerialBLE(10,11) as it says to in the example sketch. However, this is also the part the Gunner told me I need to change, so I’m a little confused there.
Also, now I am trying to connect to my HM-10 from my phone and it’s not doing it even though I was never having issues with this before. It says “Can’t connect. Please retry or choose another device.” If I try to connect and while it says “Connecting” I hit ok in the top left and then go back to try to connect it says that I am connected. Yet, when I hit the play button it immediately says that I am not connected.