Download Print this page

RHINO RMCS-2305 Operating Manual page 14

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

Advertisement

Sample code for speed control using potentiomer :
Here you can check this code of Arduino to run motor with potentiomer and Arduino :
//Constants:
const int PwmPin = 9; //pin 9 has PWM funtion
const int potPin = A0; //pin A0 to read analog input
//Variables:
int value; //save analog value
void setup(){
//Input or output?
pinMode(PwmPin, OUTPUT);
pinMode(potPin, INPUT);
}
void loop(){
value = analogRead(potPin);
value = map(value, 0, 1023, 0, 255); //Map value 0-1023 to 0-255 (PWM)
analogWrite(PwmPin, value);
delay(100);
}
//Read and save analog value from potentiometer
//Send PWM value to drive
//Small delay
https://www.robokits.co.in/
14 |
P a g e

Advertisement

loading