Ceci est une ancienne révision du document !
Lacrymo
- Porteur du projet : Guillaume Chalte
- Fichiers utiles : patch malinette audio
Note d'intention
Séquencer le déclenchement de diffuseurs de fumée cachés dans des capsules de bombe lacrymogene trouvés dans la rue après des manifestations.
Afin de pouvoir déclencher successivement des fumée provenant de capsule de bombe lacrymogene. Fumée produite avec PROPYLENE GLYCOL (e-cigarette) + huile essentielle menthe poivrée pour l'ambiance piquante.
Références et liens
- Notez ici les références artistiques et techniques, ou autres influences
Notes techniques et matériaux
- arduino uno
- relai 5v (x8)
- cables jumper
- alimentation pc (5v utilisé)
- dominos
- fil nichrome 26g
// --------------------------------------------------------------------------- // Example NewPing library sketch that does a ping about 20 times per second. // --------------------------------------------------------------------------- #include <SoftwareSerial.h> #include "RedMP3.h" #define MP3_RX 7//RX of Serial MP3 module connect to D7 of Arduino #define MP3_TX 8//TX to D8, note that D8 can not be used as RX on Mega2560, you should modify this if you donot use Arduino UNO MP3 mp3(MP3_RX, MP3_TX); int8_t index = 0x01;//the first song in the TF card int8_t volume = 0x1a;//0~0x1e (30 adjustable level) #include <NewPing.h> #define TRIGGER_PIN 11 // Arduino pin tied to trigger 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. int distonce = 0; NewPing sonar(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE); // NewPing setup of pins and maximum distance. void setup() { // Serial.begin(115200); // Open serial monitor at 115200 baud to see ping results. pinMode(5, OUTPUT); digitalWrite(5, HIGH); delay(500);//Requires 500ms to wait for the MP3 module to initialize Serial.begin(9600); } void loop() { delay(50); int distonce = sonar.ping_cm(); if (distonce > 1) { mp3.playWithVolume(index,volume); digitalWrite(5, HIGH); delay(8000);//you should wait for >=50ms between two commands digitalWrite(5, LOW); delay(3000);//you should wait for >=50ms between two commands } }