Moteur courant continu / Ne tourne pas

Bonjour, voici mon code :

const char entree = A2;

void setup() {
  pinMode(entree, OUTPUT);
  pinMode(A3, OUTPUT);
  

  Serial.begin(9600);

}

void loop() {
  digitalWrite(A3, LOW);

  int hydro = analogRead(entree);
  if(hydro < 170){
    digitalWrite(A3, 254);
    delay(3000);
    digitalWrite(A3, 0);
    Serial.println("Arrosage réalisé");
    
  }
  
  Serial.println(hydro);
  delay(500);
  
}

Puis quand je televerse le programme, le moteur a courant continu qui se strouve sur le pin A3 ne tourne pas ?

Pourquoi ?

Did you connect the motor directly to pin A3? :astonished:

  pinMode(entree, OUTPUT);

INPUT?
(If you're only using it as an analogue input, the pinMode is unnecessary)

digitalWrite(A3, 254);

A simple HIGH gives the same result as 254 in this case.

Ok I will come back to you

It doesn't work

...is the worst thing you could post here.

Is the (unspecified) DC motor connected directly to an output pin of your (unspecified) processor?

@syplosis

Your post was MOVED to its current location as it is more suitable.

Could you also take a few moments to Learn How To Use The Forum.

Other general help and troubleshooting advice can be found here.
It will help you get the best out of the forum in the future.

on passe juste HIGH ou LOW à digitalWrite. Vouliez vous dire analogWrite() ?

Merci de lire les recommandations listées dans "Les bonnes pratiques du Forum Francophone” et de poster un schéma de votre montage. je suppose que le moteur n'est pas directement accroché sur A3 ?