Hey! I got my hands into a Leonardo board a couple days ago, and i've been trying so hard to get dc motors running, i cannot figure out where's my mistake the code seems to be right, i know it's a dumb problem, any tip is helpful at this point. Thank you!
Welcome to the forum
Please post your code, using code tags when you do, and a schematic of your project showing all of its elements and how they are powered
I assume (hope) that you have not got the motors connected directly to the Leo
Welcome to the forum.
Please read How To Get The Best Out Of This Forum
So that others may help you, please post your code using code tags, as explained in the article above, and a wiring diagram for your project.
I have two motors connected, ML1 and ML2 (correct me if sent anything wrong, im'm completely new)
#include <Arduino.h>
#include <Wire.h>
#include <MrtDuino.h>
char readValue=0;
MrtMotor motor17(17);
MrtMotor motor19(19);
void setup(){
Serial.begin(115200);
SoftPWMBegin();
}
void loop(){
motor17.runMotor(100);
motor19.runMotor(100);
if(Serial.available()){
readValue=Serial.read();
Some of your code seems to be missing
Sorry, but I have no idea what I am looking at in that photo. What is it and where is the Leonardo ?
Somebody told me it could be coded as a Leonardo, am i that dumb?
This board is arduino compatible. If you are using the Arduino IDE you must select the Leonardo board to upload the code. You can program this board of three ways at the moment:
- MRTScratch: In scratch mode directly
- BlockyDuino: Firstable you must create the program with blocks and then the code must be loaded in Arduino
- Arduino IDE: Directly in C code.
What is it exactly ?
Can you please post a link to the device that explains what it is and how it is used
It is a MRTduino
I already got some simple projects running like some LEDs and servo motors
Perhaps try this.
#include <Arduino.h>
#include <Wire.h>
#include <MrtDuino.h>
char readValue=0;
MrtMotor motor14(14);
MrtMotor motor16(16);
void setup(){
Serial.begin(115200);
SoftPWMBegin();
}
void loop(){
motor14.runMotor(100);
motor16.runMotor(100);
}
According to this ML1 and ML2 are ports 14 and 16. Never programmed one though so? ,Well I ain't a pro.
Finally got those mfers running. Why does it have four dc motors outputs if the motors shouldn't be connected there??? Honestly im kind of upset of how dumb this is, but at the same time i'm pretty happy with the results. Thank you so much for your time and patience!!
If you turn dip switches 1-4 on the DC motor ports may work. In your picture they are off.(Turn them all on for that matter)
I'm having some other issues right now, i'll make some research myself to not feel dumb
The motors don't stop and they run on every single port
I ran into a lot of problem, the motors do not stop, i can't upload any code to the board, i can't reset it because when i press the reset button the motor speed increases ![]()


