Motor Driving

Hello,
I have a project research, that i should know how to program the motor driver through arduino
for example (MD03) driver, If any body can help me with videos or links please help.

The homework hotline is down for maintenance. Try again in 6 months.

MD03 Technical Documentation seems pretty comprehensive.

I followed the instruction in the link and i also do the connection as in
Arduino Examples?
and I uploaded that code to arduino Uno:

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

#define ADDRESS 0x58 // Address of MD03
#define SOFTREG 0x07 // Byte to read software
#define CMDBYTE 0x00 // Command byte
#define SPEEDBYTE 0x02 // Byte to write to speed register
#define TEMPREG 0x04 // Byte to read temprature
#define CURRENTREG 0x05 // Byte to read motor current

#define LCD_RX 0x02 // Pin for rx
#define LCD_TX 0x03 // Pin for tx
#define LCD03_HIDE_CUR 0x04
#define LCD03_CLEAR 0x0C
#define LCD03_SET_CUR 0x02

SoftwareSerial lcd_03 = SoftwareSerial(LCD_RX, LCD_TX); // Sets up serial for LCD03

byte direct = 1; // Stores what direction the motor should run in

void setup(){
lcd_03.begin(9600); // Begin serial for LCD03

Wire.begin();
delay(100);

lcd_03.write(LCD03_HIDE_CUR); // Hides LCD03 cursor
lcd_03.write(LCD03_CLEAR); // Clears LCD03 screen

int software = getData(SOFTREG); // Gets software version and prints it to LCD03
lcd_03.print("MD03 Example V:");
lcd_03.print(software);
}

void loop(){
for(int i = 0; i < 250; i=i+10){
sendData(SPEEDBYTE, i); // Sets speed to i
sendData(CMDBYTE, direct); // Sets motor to direct, a value of 1 runs the motor forward and 2 runs backward
int temp = getData(TEMPREG); // Gets temperature
lcd_03.write(LCD03_SET_CUR);
lcd_03.write(21);
lcd_03.print("temprature: ");
lcd_03.print(temp); // Prints temperature to LCD03
lcd_03.print(" "); // Prints spaces to clear space after data
delay(50); // Wait to make sure all data sent
int current = getData(CURRENTREG); // Gets motor current
lcd_03.write(LCD03_SET_CUR);
lcd_03.write(41);
lcd_03.print("Motor current: ");
lcd_03.print(current);
lcd_03.print(" ");
delay(50); // Wait to make sure all data sent
}
if(direct == 1) // If loop that swaps value of direct between 1 and 2 each time through loop
direct = 2;
else
direct = 1;
}

byte getData(byte reg){ // function for getting data from MD03
Wire.beginTransmission(ADDRESS);
Wire.write(reg);
Wire.endTransmission();

Wire.requestFrom(ADDRESS, 1); // Requests byte from MD03
while(Wire.available() < 1); // Waits for byte to become availble
byte data = Wire.read();

return(data);
}

void sendData(byte reg, byte val){ // Function for sending data to MD03
Wire.beginTransmission(ADDRESS); // Send data to MD03
Wire.write(reg);
Wire.write(val);
Wire.endTransmission();
}
and it is not working !! the motor is not working , I measure the voltage at MOT two pins and it gives me 0!
Can any body give me a video tutorial :frowning: am so depressed

What troubleshooting steps have you taken so far.

What mode are you running it in? Do you understand how each of those modes works, in concept. If using I2C, for example*, have you read up on I2C for example so as to understand what it is and what its connections need to be? Have you run the i2c scanner to see if your device is on the bus?

*The code uses the wire library.....

What experience do you have of Arduino?- if you're brand new, you're starting in the wrong place with that project, imo.

Not sure about your connection. You never showed yours. Did you connect a 12V supply to the motor driver?