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?
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
...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.
J-M-L
September 1, 2021, 10:39am
7
syplosis:
digitalWrite(A3, 254);
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 ?
system
Closed
December 30, 2021, 10:39am
8
This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.