Outils pour utilisateurs

Outils du site


wiki:flossmanuals:table-mixage-images:accueil

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
wiki:flossmanuals:table-mixage-images:accueil [2021/06/07 14:40]
damien.muti
wiki:flossmanuals:table-mixage-images:accueil [2021/06/28 14:45] (Version actuelle)
damien.muti
Ligne 17: Ligne 17:
  
 {{ :wiki:flossmanuals:table-mixage-images:table_mixage_images.png?400 |}} {{ :wiki:flossmanuals:table-mixage-images:table_mixage_images.png?400 |}}
 +
 +{{ :wiki:flossmanuals:table-mixage-images:img_7729.jpg?400 |}}
  
 ===== Algorithme ===== ===== Algorithme =====
Ligne 28: Ligne 30:
 le fichier Fritzing correspondant est le suivant : {{ :wiki:flossmanuals:table-mixage-images:montage_5_potentiometres.fzz.zip |}} le fichier Fritzing correspondant est le suivant : {{ :wiki:flossmanuals:table-mixage-images:montage_5_potentiometres.fzz.zip |}}
  
-==== Programmes ====+==== Programmes Arduino ====
  
-Le code permettant :+Le code permettant de mesurer les valeurs sur les 5 potentiomètres et de les envoyer via le port série est le suivant :
  
-  * {{ :wiki:flossmanuals:rfid-lecteur-mp3:test_rfid_mp3.zip |}}+  * {{ :wiki:flossmanuals:table-mixage-images:tablemixagearduino.zip |}}
  
 <code> <code>
-/* Meet +int Sensor [ ] = {0, 0, 0, 0, 0}; 
-  Nouvelle réunion +byte N = 5; 
-  Rejoindre une réunion +int inByte = 0;         // incoming serial byte
-  Hangouts +
-  2 sur 8 224 +
-  RFID +
-  Boîte de réception +
-  Théo Radakovitch <theo@lafabulerie.com>+
  
-  14:43 (il y a 2 minutes)+boolean debug = false;
  
-  À moi, Célia 
  
-  Traduire le message 
-  Désactiver pour : anglais 
-  /* Typical pin layout used: 
-   ----------------------------------------------------------------------------------------- 
-               MFRC522      Arduino       Arduino   Arduino    Arduino          Arduino 
-               Reader/PCD   Uno/101       Mega      Nano v3    Leonardo/Micro   Pro Micro 
-   Signal      Pin          Pin           Pin       Pin        Pin              Pin 
-   ----------------------------------------------------------------------------------------- 
-   RST/Reset   RST          9                     D9         RESET/ICSP-5     RST 
-   SPI SS      SDA(SS)      10            53        D10        10               10 
-   SPI MOSI    MOSI         11 / ICSP-4   51        D11        ICSP-4           16 
-   SPI MISO    MISO         12 / ICSP-1   50        D12        ICSP-1           14 
-   SPI SCK     SCK          13 / ICSP-3   52        D13        ICSP-3           15 
-*/ 
-//////////////////////////SON/////////////////// 
-#include "WT2003S_Player.h" 
  
 +void setup() {
 +  // création du tableau Sensor
 +  //  Sensor = malloc(N*sizeof(int));
  
-#ifdef __AVR__ +  Serial.begin(9600); 
-#include <SoftwareSerial.h> +  while (!Serial
-SoftwareSerial SSerial(2, 3); // RX, TX +    ; // wait for serial port to connect. Needed for native USB port only 
-#define COMSerial SSerial +  } 
-#define ShowSerial Serial+  establishContact();  // send a byte to establish contact until receiver responds 
 +}
  
-WT2003S<SoftwareSerial> Mp3Player; 
-#endif 
  
-#ifdef ARDUINO_SAMD_VARIANT_COMPLIANCE +void loop() { 
-#define COMSerial Serial1 +  for (int i = 0; i < Ni++) 
-#define ShowSerial SerialUSB +    //lire la valeur du capteur 
- +    Sensor [i= map(analogRead(i)0, 1023, 0, 255)
-WT2003S<Uart> Mp3Player; +    //envoyer la valeur 
-#endif +    if (debug) { 
- +      Serial.print("Sensor["); 
-#ifdef ARDUINO_ARCH_STM32F4 +      Serial.print(i); 
-#define COMSerial Serial +      Serial.print("]="); 
-#define ShowSerial SerialUSB +      Serial.print(Sensor[i]); 
- +      Serial.print(   "); 
-WT2003S<HardwareSerial> Mp3Player; +    } 
-#endif +    else { 
- +      Serial.write(Sensor[i]); 
- +    }
-uint8_t vol = 31; +
-uint32_t spi_flash_songs = 0; +
-uint32_t sd_songs = 0; +
-STROAGE workdisk = SD; +
-struct Play_history +
-  uint8_t disk; +
-  uint16_t index; +
-  char name[8]+
-}* SPISong*SDSong+
- +
-void readSongName(struct Play_history* ph, uint32_t num, STROAGE disk) { +
-  Mp3Player.volume(0); +
-  delay(100); +
-  switch (disk+
-    case SPIFLASH: +
-      Mp3Player.playSPIFlashSong(0x0001); +
-      break; +
-    case SD: +
-      Mp3Player.playSDRootSong(0x0001); +
-      break; +
-    case UDISK: +
-      Mp3Player.playUDiskRootSong(0x0001); +
-      break;+
   }   }
-  ShowSerial.println("2..."); +  if (debug) { 
-  for (int i = 0; i < num ; i++) { +    Serial.println("");
-    delay(300); +
-    ph[i].disk = disk; +
-    ph[i].index = Mp3Player.getTracks(); +
-    Mp3Player.getSongName(ph[i].name); +
-    Mp3Player.next();+
   }   }
-  ShowSerial.println("4..."); 
-  Mp3Player.pause_or_play(); 
-  Mp3Player.volume(14); 
-  delay(100); 
 } }
  
-void getAllSong() { +void establishContact() { 
-  uint8_t diskstatus = Mp3Player.getDiskStatus(); +  while (Serial.available() <= 0) { 
-  ShowSerial.println(diskstatus)+    Serial.print('A');   // send a capital A 
-  spi_flash_songs Mp3Player.getSPIFlashMp3FileNumber(); +    delay(300);
-  ShowSerial.print("SPIFlash:"); +
-  ShowSerial.println(spi_flash_songs); +
-  if (spi_flash_songs > 0) { +
-    SPISong = (struct Play_history*)malloc((spi_flash_songs + 1) * sizeof(struct Play_history)); +
-    readSongName(SPISong, spi_flash_songs, SPIFLASH); +
-  } +
-  if (diskstatus && 0x02) { // have SD +
-    sd_songs = Mp3Player.getSDMp3FileNumber(); +
-    ShowSerial.print("SD:"); +
-    ShowSerial.println(sd_songs); +
-    if (sd_songs > 0) { +
-      SDSong = (struct Play_history*)malloc((sd_songs + 1) * sizeof(struct Play_history)); +
-      ShowSerial.println("1..."); +
-      readSongName(SDSong, sd_songs, SD); +
-    }+
   }   }
 } }
-void printSongs() { +</code>
-  ShowSerial.print("-------------------"); +
-  ShowSerial.print("index"); +
-  ShowSerial.print("<-------->"); +
-  ShowSerial.print("name"); +
-  ShowSerial.print("-------------------"); +
-  ShowSerial.println(); +
-  ShowSerial.println("-------------------spi flash-------------------------------"); +
-  for (int i = 0 ; i < spi_flash_songs; i++) { +
-    ShowSerial.print("-------------------"); +
-    ShowSerial.print(SPISong[i].index); +
-    ShowSerial.print("<-------->"); +
-    ShowSerial.print(SPISong[i].name); +
-    ShowSerial.print("-------------------"); +
-    ShowSerial.println(); +
-  } +
-  ShowSerial.println("-------------------sd card-------------------------------"); +
-  for (int i = 0 ; i < sd_songs; i++) { +
-    ShowSerial.print("-------------------"); +
-    ShowSerial.print(SDSong[i].index); +
-    ShowSerial.print("<-------->"); +
-    ShowSerial.print(SDSong[i].name); +
-    ShowSerial.print("-------------------"); +
-    ShowSerial.println(); +
-  } +
-+
-//////////////////////////////// RFID //////////// +
-#include <SPI.h> +
-#include <MFRC522.h>+
  
-#define SS_PIN 10 +===== Programme Processing =====
-#define RST_PIN 9+
  
-MFRC522 rfid(SS_PINRST_PIN); // Instance of the class+Le programme Processing permettant de récupérer les données envoyées par la cartes et de les considérer comme des paramètres permettant de faire varier les aspects visuels d'une images (rougevert, bleu, luminance, saturation et un paramètre de filtrageest le suivant : 
  
-MFRC522::MIFARE_Key key;+  * {{ :wiki:flossmanuals:table-mixage-images:tablemixageprocessing.zip |}}
  
-// Init array that will store new NUID +<code> 
-byte nuidPICC[4];+/**  //<>// 
 + * Serial Call-Response  
 + * by Tom Igoe.  
 + *  
 + * Sends a byte out the serial port, and reads 3 bytes in.  
 + * Sets foregound color, red, and green of a circle onstage 
 + * using the values returned from the serial port.  
 + * Thanks to Daniel Shiffman  and Greg Shakar for the improvements. 
 + *  
 + * Note: This sketch assumes that the device on the other end of the serial 
 + * port is going to send a single byte of value 65 (ASCII A) on startup. 
 + * The sketch waits for that byte, then sends an ASCII A whenever 
 + * it wants more data.  
 + */
  
-int valRFID = 0; // numéro de tag RFID+//déclaration de des variables image 
 +PImage img1; 
 +//je ne sais pas encore quels sont ces entiers 
 +int picAlpha = 255;
  
-//DFPLAYER+import processing.serial.*;
  
-#include <SoftwareSerial.h>+int bgcolor;      // Background color 
 +//int fgcolor;      // Fill color 
 +Serial myPort;                       // The serial port 
 +int N = 5 ; // nombre de valeurs lue, venant de la carte Arduino 
 +int[] serialInArray = new int[N];    // Where we'll put what we receive 
 +int serialCount = 0;                 // A count of how many bytes we receive 
 +int red, green, blue, alpha, filt;              // Starting position of the ball 
 +boolean firstContact = false;        // Whether we've heard from the microcontroller
  
 +void setup() {
 +  size(420, 420);  // Stage size
 +  noStroke();      // No border on the next thing drawn
  
 +  img1= loadImage("image1.JPG"); //récupération de l'image 1 dans le dossier
 +  //img1= loadImage("image2.jpg"); //récupération de l'image 1 dans le dossier
 +  //img1= loadImage("image3.jpg"); //récupération de l'image 1 dans le dossier
 +  img1.resize(410, 410); //taille de l'image 1 sur le screen
  
-int ledPin = 6; 
  
 +  // parametres associés aux boutons Sensor lus par la carte arduino
 +  red = width/2;
 +  green = height/2;
 +  blue=0;
 +  alpha=0;
 +  filt=2;
  
 +  // Print a list of the serial ports, for debugging purposes:
 +  printArray(Serial.list());
  
-void setup() +  // I know that the first port in the serial list on my mac 
-{ +  // is always my  FTDI adaptor, so I open Serial.list()[0]. 
-  //Serial.begin(115200)+  // On Windows machines, this generally opens COM1. 
- +  // Open whatever port is the one you're using. 
-  SPI.begin(); // Init SPI bus +  String portName = Serial.list()[11]
-  rfid.PCD_Init(); // Init MFRC522 +  myPort = new Serial(thisportName, 9600); 
- +}
-  for (byte i 0; i < 6; i++) { +
-    key.keyByte[i] = 0xFF; +
-  } +
- +
-  Serial.println(F("This code scan the MIFARE Classsic NUID.")); +
-  Serial.print(F("Using the following key:")); +
-  printHex(key.keyByteMFRC522::MF_KEY_SIZE); +
- +
- +
- +
-  Serial.println("initializing RFID..."); +
- +
-  /////////////////SON //////////////////+
  
-  while (!ShowSerial)+void draw() { // affichage dans la fenêtre graphique
-  ShowSerial.begin(9600); +
-  COMSerial.begin(9600); +
-  ShowSerial.println("+++++++++++++++++++++++++++++++++++++++++++++++++++++"); +
-  Mp3Player.init(COMSerial);+
  
-  ShowSerial.println("0..."); +  //je ne sais pas encore ce que c'est 
-  getAllSong(); +  //picAlpha = int(map(red, 0, 255, 0, width)); 
-  printSongs()+
-  Mp3Player.volume(vol);+
  
 +  background(255);
 +  fill(255);
  
 +  tint(green+100, red, blue-56, alpha);//teinte de l'image en fonction du déplacement de la souris
 +  image(img1, 5, 5);//imoage + positionnement de l'image
  
 +  // Draw the shape
 +  //ellipse(red, green, blue, 20);
 +  
 +  filter(POSTERIZE, map(filt,0,255,2,128));
 } }
  
-void light() { // éclaire la led 3secondes après déclenchement son +void serialEvent(Serial myPort) { // gestion du dialogue avec la carte Arduino 
-  digitalWrite(ledPin, HIGH); +  // read a byte from the serial port: 
-  digitalWrite(ledPinLOW); +  int inByte = myPort.read(); 
-}+  // if this is the first byte receivedand it's an A, 
 +  // clear the serial buffer and note that you've 
 +  // had first contact from the microcontroller.  
 +  // Otherwise, add the incoming byte to the array: 
 +  if (firstContact == false) { 
 +    if (inByte == 'A') {  
 +      myPort.clear();          // clear the serial port buffer 
 +      firstContact = true;     // you've had first contact from the microcontroller 
 +      myPort.write('A');       // ask for more 
 +    } 
 +  } else { 
 +    // Add the latest byte from the serial port to array: 
 +    serialInArray[serialCount] = inByte; 
 +    serialCount++;
  
 +    // If we have N bytes:
 +    if (serialCount > N-1 ) {
 +      red = serialInArray[0];
 +      green = serialInArray[1];
 +      blue = serialInArray[2];
 +      alpha = serialInArray[3];
 +      filt = serialInArray[4];
  
-void printHex(byte *buffer, byte bufferSize{ +      // print the values (for debugging purposes only): 
-  for (byte i 0; i < bufferSize; i++) { +      println("red=red + "\t"green="+green + "\t" +"blue=" + blue + "\t" +"alpha="+ alpha + "\t" +"filt="+ filt );
-    Serial.print(buffer[i] < 0x10 ? 0" "); +
-    Serial.print(buffer[i], HEX); +
-  } +
-}+
  
-/** +      // Send capital A to request new sensor readings
-   Helper routine to dump byte array as dec values to Serial. +      myPort.write('A'); 
-*/ +      // Reset serialCount: 
-void printDec(byte *buffer, byte bufferSize) { +      serialCount 0; 
-  for (byte i = 0; i < bufferSize ; i++) { +    }
-    Serial.print(buffer[i] < 0x10 ? " 0" " "); +
-    Serial.print(buffer[i], DEC); +
-    Serial.println(""); +
-    //valRFID buffer[i];+
   }   }
 } }
  
-int convertNumRFID(byte *buffer, byte bufferSize) { 
-  int valRFID = 0; 
-  for (byte i = 0; i < bufferSize ; i++) { 
-    valRFID += buffer[i]; 
-  } 
-  Serial.print("Numero Tag RFID = "); 
-  Serial.println(valRFID); 
-  return valRFID; 
-} 
- 
-void audio(int cmd) { 
-  ShowSerial.print("play:"); 
-  if (workdisk == SD) { 
-    Mp3Player.playSDRootSong(cmd); 
-    ShowSerial.print(cmd + ": "); 
-    ShowSerial.print(SDSong[cmd - '0'].name); 
-  } 
-  if (workdisk == SPIFLASH) { 
-    Mp3Player.playSPIFlashSong(cmd - '0' - 1); 
-    ShowSerial.print(cmd + ": "); 
-    ShowSerial.print(SPISong[cmd - '0'].name); 
-  } 
-  ShowSerial.println(); 
-} 
- 
-void loop() { 
- 
-  // Reset the loop if no new card present on the sensor/reader. This saves the entire process when idle. 
-  if ( ! rfid.PICC_IsNewCardPresent()) 
-    return; 
- 
-  // Verify if the NUID has been readed 
-  if ( ! rfid.PICC_ReadCardSerial()) 
-    return; 
- 
-  printDec(rfid.uid.uidByte, rfid.uid.size); 
-  valRFID = convertNumRFID(rfid.uid.uidByte, rfid.uid.size); 
-  //debug 
-  Serial.print("valRFID = "); 
-  Serial.println(valRFID); 
- 
- 
-  Serial.println(); 
- 
-  // Halt PICC 
-  rfid.PICC_HaltA(); 
- 
-  // Stop encryption on PCD 
-  rfid.PCD_StopCrypto1(); 
- 
- 
-  //Serial.println(valRFID); 
-  //delay(50); 
- 
-  if (valRFID == 387) { // Sapin 
-    audio(1); 
-    Serial.println("Sapin"); 
-    light(); 
-  } 
- 
-  if (valRFID == 403) { //Ours 
-    audio(7); 
-    Serial.println("Ours"); 
-    light(); 
-  } 
- 
-  if (valRFID == 280) { // Chien 
-    audio(3); 
-    Serial.println("Chien"); 
-    light(); 
-  } 
- 
-  if (valRFID == 499) {  // Chaise 
-    audio(4); 
-    Serial.println("Chaise"); 
-    light(); 
-  } 
- 
-  if (valRFID == 607) {  // Bateau 
-    audio(5); 
-    Serial.println("Bateau"); 
-    light(); 
-  } 
-  if (valRFID == 673) {  // Perroquet 
-    audio(6); 
-    Serial.println("Perroquet"); 
-    light(); 
-  } 
-  if (valRFID == 581) {  // Vache 
-    audio(2); 
-    Serial.println("Vache"); 
-    light(); 
-  } 
-} 
 </code> </code>
  
-Pour que ce code fonctionne, il convient de placer les sons au formats "mp3" à la racine de la carte SD du module mp3 Grove V3. Ici il s'agir de sons : 
-  * Sapin 
-  * Ours 
-  * Chien 
-  * Chaise 
-  * Bateau 
-  * Perroquet 
-  * Vache 
  
-L'ensemble des sons peuvent être téléchargés sur le lien suivant : {{ :wiki:flossmanuals:rfid-lecteur-mp3:sons.zip |}} +===== Réalisation de la maquette et visuels =====
-==== Références : Contrôle d’accès par badge RFID avec Arduino ==== +
-Le programme permettant de détecter l'identifiant unique du tag est le suivant : [[https://www.electronique-mixte.fr/microcontrolleurs/rfid-controle-dacces-par-badge-avec-arduino/|RFID : Contrôle d’accès par badge avec Arduino]] +
  
 +{{ :wiki:flossmanuals:table-mixage-images:capture_d_ecran_2021-03-23_a_15.42.20.png?400 |}}
 +{{ :wiki:flossmanuals:table-mixage-images:capture_d_ecran_2021-03-23_a_15.42.57.png?400 |}}
 +{{ :wiki:flossmanuals:table-mixage-images:capture_d_ecran_2021-03-23_a_15.43.12.png?400 |}}
 +{{ :wiki:flossmanuals:table-mixage-images:capture_d_ecran_2021-03-23_a_15.43.37.png?400 |}}
 +{{ :wiki:flossmanuals:table-mixage-images:capture_d_ecran_2021-03-23_a_15.44.21.png?400 |}}
  
-===== Réalisation de la maquette ===== 
-vidéos, photos du making of... 
  
 +===== Références :  =====
 +La documentation sur les filtres d'images Processing est la suivante :
 +  * [[https://processing.org/reference/PImage_filter_.html|PImage > filter]]
wiki/flossmanuals/table-mixage-images/accueil.1623069655.txt.gz · Dernière modification: 2021/06/07 14:40 de damien.muti