Hello,
can someone tell me how I can Drive 2 Motordriver on Arduino?
Both have another Adress.
I will send a snipped of the code i testet but it didnt work…
[code]
#define driver2 0x08 //Mittleres Shield (A3 + A4)
#define driver1 0x0c //Unteres Shild (A1 + A2)
#define shield1 Motor
#define shield2 Motor
void setup() {
shield1.begin(driver1);
shield2.begin(driver2);
}
void loop() {
[…]
if (a1 == true) {
shield1.speed(MOTOR1, a1_sollspeed);
}
if (a1_ist = a1_sollpos) {
shield1.stop(MOTOR1);
}
// Achse 2
if (a2 == true) {
shield1.speed(MOTOR2, a2_sollspeed);
}
if (a2_ist = a2_sollpos) {
shield1.stop(MOTOR2);
}
// Achse 3
if (a3 == true) {
shield2.speed(MOTOR1, a3_sollspeed);
}
if (a3_ist = a3_sollpos) {
shield2.stop(MOTOR1);
}
// Achse 4
if (a4 == true) {
shield2.speed(MOTOR2, a4_sollspeed);
}
if (a4_ist = a4_sollpos) {
shield2.stop(MOTOR2);
}
}
[/code]
hope someone can help.