Download Print this page

RHINO RMCS-2305 Operating Manual page 12

Dual channel optically isolated dc motor driver 6v-30v 20amp

Advertisement

Sample code for motor control using Arduino :
Here you can check this sample code of Arduino to run motor with arduino :
/* Connections of RMCS-2305 with arduino :
* RMCS2305 : Arduino pins
* Sleep1 : 2
* Gnd : gnd
* Dir1 : 3
* pwm1 : 5
* pwm2 : 6
* Dir2 : 7
* Sleep2 : 8
*/
const int Sleep1 = 2; //For the motor M1
const int Dir1 = 3; //pin to change direction for motor M1
const int pwm1 = 5; //Pwm pin for motor M1
const int pwm2 = 6;// Pwm pin for motor M2
const int Dir2 = 7; // pin to change direction for motor M2
const int Sleep2 = 8; //For the motor M2
void setup()
{
pinMode(Sleep1,OUTPUT);
pinMode(Dir1,OUTPUT);
pinMode(pwm1,OUTPUT);
pinMode(pwm2,OUTPUT);
pinMode(Dir2,OUTPUT);
pinMode(Sleep2,OUTPUT);
}
void loop() {
digitalWrite(Sleep1,LOW); // To stop motor M1 change Signal to HIGH
digitalWrite(Dir1,HIGH); // To change the direction of motor M1, change signal to LOW
digitalWrite(Sleep2,LOW); // To stop motor M2 change Signal to HIGH
digitalWrite(Dir2,HIGH); // To change the direction of motor M2, change signal to LOW
analogWrite(pwm1,255); // you can give value in between 0 - 255
analogWrite(pwm2,255); // you can give value in between 0 - 255
}
https://www.robokits.co.in/
12 |
P a g e

Advertisement

loading