Voila je suis sur la gestion des capteurs SRF04 avec Arduino en ce moment avec un ami et j'ai un léger problème.
On à une arduino Uno alimenté par USB et un capteur branché dessus (le montage est correct, maintes fois vérifié).
Le problème qu'on à, c'est que notre capteur chauffe beaucoup. Le plastique protecteur du SRF04 est un peu fondu à l'arrière :S
C'est chaud au toucher, ça fait presque mal parfois.
Voila notre code :
#define echoPin 3 // Pin to receive echo pulse #define trigPin 2 // Pin to send trigger pulse void setup(){ Serial.begin(9600); pinMode(echoPin, INPUT); pinMode(trigPin, OUTPUT); } void loop(){ digitalWrite(trigPin, LOW); // Set the trigger pin to low for 2uS delayMicroseconds(2); digitalWrite(trigPin, HIGH); // Send a 10uS high to trigger ranging delayMicroseconds(10); digitalWrite(trigPin, LOW); // Send pin low again int distance = pulseIn(echoPin, HIGH); // Read in times pulse distance= distance/58; // Calculate distance from time of pulse Serial.println(distance); delay(2000); // Wait 50mS before next ranging }
Et le capteur renvoie des nombres négatifs entre -420 et -460, alors voila ... je suis un peu embêté.
Est ce que quelqu'un saurait m'aider ?
Je vous en remercie d'avance !
Xaltar