Hello, I am just trying to get the Cytron SmartDrive 40 to work in PWM mode with a standard Arduino Mega.
I have the DIP switches set to the following positions:
1:1
2:0
3:0
4:0
5:0
6:1
7:0
8:0
I have the inputs connected to an Arduino Mega like this:
Input 1 connected to Pin 2
Input 2 connected to Pin 26
Ground on the smartdrive connected to ground on the Mega.
The 5 volt pin on the smartdrive not connected with anything.
I then tried to run the following code on the Mega:
void setup()
{
pinMode (2,OUTPUT);
pinMode (26,OUTPUT);
}
void loop()
{
analogWrite (2,0); //set PWM pin to low
digitalWrite(26,0);
delay (5000);
analogWrite (2,255); //set PWM pin to high
}
When I connected the arduino with this code, I can observe that I do not get the Input Error (I do not see the LED flash 2 times) however, when the PWM goes to high, the motor does not spin.
I tried more experiments, and I saw that when I uploaded code to the arduino while it was connected to the SmartDrive the motor would spin, and then it would stop after the code had finished uploading. I am also capable of driving the motor using the push buttons on the SmartDrive.
Any help or assistance would be greatly appreciated. I used the Cytron 10Amp DC Motor Driver in the past and I was very happy with it.