projets:lacrymo:start

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentes Révision précédente
Prochaine révision
Révision précédente
projets:lacrymo:start [2021/03/18 11:34]
admin
projets:lacrymo:start [2022/10/26 09:50] (Version actuelle)
admin [Notes techniques et matériaux]
Ligne 20: Ligne 20:
 ===== Notes techniques et matériaux ===== ===== Notes techniques et matériaux =====
   * arduino uno  (2 lib : RedMP3.h  et  NewPing.h)   * arduino uno  (2 lib : RedMP3.h  et  NewPing.h)
 +  * [[https://github.com/ArtronShop/OPEN-SMART-RedMP3]]
   * relai 5v (x8)   * relai 5v (x8)
   * cables jumper   * cables jumper
Ligne 40: Ligne 41:
 #define ECHO_PIN     12  // Arduino pin tied to echo pin on the ultrasonic sensor. #define ECHO_PIN     12  // Arduino pin tied to echo pin on the ultrasonic sensor.
 #define MAX_DISTANCE 200 // Maximum distance we want to ping for (in centimeters). Maximum sensor distance is rated at 400-500cm. #define MAX_DISTANCE 200 // Maximum distance we want to ping for (in centimeters). Maximum sensor distance is rated at 400-500cm.
- 
 int distonce = 0; int distonce = 0;
 NewPing sonar(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE); // NewPing setup of pins and maximum distance. NewPing sonar(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE); // NewPing setup of pins and maximum distance.
Ligne 50: Ligne 50:
   digitalWrite(6, HIGH); // on allume le relai (pour l'initialiser   digitalWrite(6, HIGH); // on allume le relai (pour l'initialiser
  
-   
   delay(500);//Requires 500ms to wait for the MP3 module to initialize     delay(500);//Requires 500ms to wait for the MP3 module to initialize  
   Serial.begin(9600);   Serial.begin(9600);
Ligne 59: Ligne 58:
 int distonce = sonar.ping_cm(); int distonce = sonar.ping_cm();
 if (distonce > 1) { if (distonce > 1) {
- +  mp3.playWithVolume(index,volume);  // on joue le premier mp3
-mp3.playWithVolume(index,volume);+
   digitalWrite(5, HIGH);   digitalWrite(5, HIGH);
   digitalWrite(6, HIGH);  // on double les relai par securité au cas ou un ne marche plus.   digitalWrite(6, HIGH);  // on double les relai par securité au cas ou un ne marche plus.
-  delay(8000);//you should wait for >=50ms between two commands+  delay(8000); 
 +  
   digitalWrite(5, LOW);   digitalWrite(5, LOW);
   digitalWrite(6, LOW);   digitalWrite(6, LOW);
-  delay(3000);//you should wait for >=50ms between two commands+  delay(3000);
     }     }
 } }
  • projets/lacrymo/start.1616063657.txt.gz
  • Dernière modification: 2021/03/18 11:34
  • de admin