Warum geht Meine Schaltung nicht?

1 Antwort

Code :

int motor1pin1 = 2;

int motor1pin2 = 3;

void setup() {

  // put your setup code here, to run once:

  pinMode(motor1pin1, OUTPUT);

  pinMode(motor1pin2, OUTPUT);

  pinMode(9, OUTPUT);

 

}

void loop() {

  // put your main code here, to run repeatedly:  

  //Controlling speed (0 = off and 255 = max speed):

  analogWrite(9, 100); //ENA pin

  //Controlling spin direction of motors:

  digitalWrite(motor1pin1, HIGH);

  digitalWrite(motor1pin2, LOW);

  delay(1000);

  digitalWrite(motor1pin1, LOW);

  digitalWrite(motor1pin2, HIGH);

  delay(1000);

}