I have a L298N based Arduino motor shield DR10009 from DFRobot.
Driving two DC motors is ok, after a few adjustments (pull-down resistors to quiet the motors on startup ; driver corrections), but I am unable to use the alternative mode of this board: PLL control, intended to drive a two-phases stepper motor.
Could it be because the PWM signals should be delivered to pins 4 and 7, as it seems from the doc:
[quote]Arduino PLL Speed Control:
int E1 = 7;
int M1 = 6;
int E2 = 4;
int M2 = 5;
void setup()
{
pinMode(M1, OUTPUT);
pinMode(M2, OUTPUT);
}
void loop()
{
int value;
for ( value = 0 ; value <= 255; value+=5 )
{
digitalWrite( M1, HIGH );
digitalWrite( M2, HIGH );
analogWrite( E1, value ); //PLL Speed Control
analogWrite( E2, value ); //PLL Speed Control
delay(30);
}
}
[/quote]
My board is FEZ Panda 2, it can deliver PWM on pins 5 and 6, but it can’t (at least natively) on 4 and 7.
Should I drive these pins entirely in a loop?
The code you sent is not intended to use for driving steppers motors.
You will be able to use this shield to drive a stepper motor, without using PWM. PWM is needed to control speed of regular motors only, or maybe to perform micro-stepping with steppers, which will be difficult to do with C# due to timing issues.
Is your stepper bipolar ?
You need to apply a stepping sequence on the “direction control” pins of your steppers, and make it change at each step.
Here is good information about steppers : Jones on Stepping Motor Types Tutorials Archives - StepperWorld
The second documents also gives several possible stepping sequences : Wave-Drive, Hi-Torque, Half-step… depending on what you wish to do. There is a lot to learn about steppers !