You are viewing an old version of this page. View the current version.
Compare with Current
View Page History
« Previous
Version 3
Next »
Kommt
Beispiel
1x Arduino
1x H-Brücke SN754410 (Datenblatt)
1x DC Motor
#define MOTOR_PIN_A 5
#define MOTOR_PIN_B 6
void setup()
{
pinMode(MOTOR_PIN_A, OUTPUT);
pinMode(MOTOR_PIN_B, OUTPUT);
}
void loop()
{
//Eine Richtung
digitalWrite(MOTOR_PIN_A, HIGH);
digitalWrite(MOTOR_PIN_B, LOW);
delay(5000);
//Andere Richtung
digitalWrite(MOTOR_PIN_A, LOW);
digitalWrite(MOTOR_PIN_B, HIGH);
delay(5000);
}
H-Brücke - Wikipedia