- DISCONTINUED
- On sale!
- -€1.00
If you have any questions on this product please feel free to contact us.
*Disclaimer: The images are merely illustrative.
Motor Control Shield is capable of driving 4 DC motors or 2 stepping motors at one time.
Note : when in operation, it's normal that the onboard motor drivers and regulators generate lots of heat.
Development resources: demo codes, schematic, datasheets, etc.
www.waveshare.com/Motor_Control_Shield
int motor1_dir1 = 12;
int motor1_dir2 = 13;
int motor1_pwm = 11;
int motor2_dir1 = 8;
int motor2_dir2 = 7;
int motor2_pwm = 10;
int motor3_dir1 = 5;
int motor3_dir2 = 4;
int motor3_pwm = 9;
int motor4_dir1 = 3;
int motor4_dir2 = 2;
int motor4_pwm = 6;
void setup()
{
pinMode(motor1_dir1,OUTPUT);
pinMode(motor1_dir2,OUTPUT);
pinMode(motor1_pwm,OUTPUT);
pinMode(motor2_dir1,OUTPUT);
pinMode(motor2_dir2,OUTPUT);
pinMode(motor2_pwm,OUTPUT);
pinMode(motor3_dir1,OUTPUT);
pinMode(motor3_dir2,OUTPUT);
pinMode(motor3_pwm,OUTPUT);
pinMode(motor4_dir1,OUTPUT);
pinMode(motor4_dir2,OUTPUT);
pinMode(motor4_pwm,OUTPUT);
digitalWrite(motor1_dir1,0);
digitalWrite(motor1_dir2,1);
digitalWrite(motor1_pwm,1);
digitalWrite(motor2_dir1,0);
digitalWrite(motor2_dir2,1);
digitalWrite(motor2_pwm,1);
digitalWrite(motor3_dir1,0);
digitalWrite(motor3_dir2,1);
digitalWrite(motor3_pwm,1);
digitalWrite(motor4_dir1,0);
digitalWrite(motor4_dir2,1);
digitalWrite(motor4_pwm,1);
}
void loop()
{
analogWrite(motor1_pwm, 128);
analogWrite(motor2_pwm, 128);
analogWrite(motor3_pwm, 128);
analogWrite(motor4_pwm, 128);
delay(500);
}
Related products