Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente | ||
projets:carte_interactive_-_centrale_mobilite:accueil [2016/11/17 18:34] resonance [Code arduino] |
projets:carte_interactive_-_centrale_mobilite:accueil [2017/10/06 17:34] (Version actuelle) resonance [Photos] |
||
---|---|---|---|
Ligne 4: | Ligne 4: | ||
* Licence : [[http:// | * Licence : [[http:// | ||
* Description : une carte de Marseille audio interactive | * Description : une carte de Marseille audio interactive | ||
- | * Fichiers sources : //mettre un lien// | + | * Fichiers sources : //a venir// |
- | * Lien : //mettre un lien// | + | * Lien : http://colorclic.fr/ |
{{tag> | {{tag> | ||
===== Description ===== | ===== Description ===== | ||
- | une carte de Marseille audio interactive | + | une carte de Marseille audio interactive, dans le cadre du projet " |
+ | {{: | ||
- | {{projets:carte_interactive_-_centrale_mobilite: | + | déroulé |
+ | | ||
+ | | ||
+ | - entretiens audios de chacun des participants sur leur parcours choisi. | ||
+ | - travail sur le support de la carte de Marseille agrandie. | ||
===== Matériaux ===== | ===== Matériaux ===== | ||
Ligne 29: | Ligne 34: | ||
===== Tutoriel ===== | ===== Tutoriel ===== | ||
==== Electronique ==== | ==== Electronique ==== | ||
- | {{ : | + | {{: |
==== Code arduino ==== | ==== Code arduino ==== | ||
Ce bout de code nécessite le télechargement des librairies specifiques : | Ce bout de code nécessite le télechargement des librairies specifiques : | ||
Ligne 38: | Ligne 43: | ||
++++ Le code Arduino | | ++++ Le code Arduino | | ||
- | <code java> | ||
#include < | #include < | ||
#include < | #include < | ||
#include < | #include < | ||
#include " | #include " | ||
+ | |||
// You can have up to 4 on one i2c bus but one is enough for testing! | // You can have up to 4 on one i2c bus but one is enough for testing! | ||
Adafruit_MPR121 cap = Adafruit_MPR121(); | Adafruit_MPR121 cap = Adafruit_MPR121(); | ||
+ | |||
// Keeps track of the last pins touched | // Keeps track of the last pins touched | ||
// so we know when buttons are ' | // so we know when buttons are ' | ||
uint16_t lasttouched = 0; | uint16_t lasttouched = 0; | ||
uint16_t currtouched = 0; | uint16_t currtouched = 0; | ||
+ | // volgen | ||
+ | int volume_mp3 = 15; | ||
+ | // del between volume changes | ||
+ | int del = 40; | ||
+ | |||
void setup() { | void setup() { | ||
while (!Serial); | while (!Serial); | ||
+ | |||
Serial.begin(9600); | Serial.begin(9600); | ||
- | Serial.println(" | + | |
- | + | ||
// Default address is 0x5A, if tied to 3.3V its 0x5B | // Default address is 0x5A, if tied to 3.3V its 0x5B | ||
// If tied to SDA its 0x5C and if SCL then 0x5D | // If tied to SDA its 0x5C and if SCL then 0x5D | ||
if (!cap.begin(0x5A)) { | if (!cap.begin(0x5A)) { | ||
- | Serial.println(" | + | |
while (1); | while (1); | ||
} | } | ||
- | Serial.println(" | + | |
+ | |||
mp3_set_serial (Serial); | mp3_set_serial (Serial); | ||
delay(1); | delay(1); | ||
mp3_set_volume (15); | mp3_set_volume (15); | ||
} | } | ||
+ | |||
void loop() { | void loop() { | ||
// Get the currently touched pads | // Get the currently touched pads | ||
currtouched = cap.touched(); | currtouched = cap.touched(); | ||
- | | + | |
for (uint8_t i=0; i<12; i++) { | for (uint8_t i=0; i<12; i++) { | ||
// it if *is* touched and *wasnt* touched before, alert! | // it if *is* touched and *wasnt* touched before, alert! | ||
if ((currtouched & _BV(i)) && !(lasttouched & _BV(i)) ) { | if ((currtouched & _BV(i)) && !(lasttouched & _BV(i)) ) { | ||
- | mp3_play (i); | + | |
- | delay (100); | + | |
+ | delay (del); | ||
+ | | ||
+ | delay (del); | ||
+ | | ||
+ | delay (del); | ||
+ | | ||
+ | delay (del); | ||
+ | | ||
+ | delay (del); | ||
+ | | ||
+ | delay (del); | ||
+ | | ||
+ | delay (del); | ||
+ | | ||
+ | delay (del); | ||
+ | | ||
+ | delay (del); | ||
+ | mp3_play (i); | ||
+ | | ||
} | } | ||
+ | |||
} | } | ||
+ | |||
// reset our state | // reset our state | ||
lasttouched = currtouched; | lasttouched = currtouched; | ||
- | + | ||
- | + | ||
// put a delay so it isn't overwhelming | // put a delay so it isn't overwhelming | ||
delay(100); | delay(100); | ||
Ligne 94: | Ligne 121: | ||
++++ | ++++ | ||
+ | ===== Extraits audio ===== | ||
+ | |||
+ | Retrouvez l' | ||
===== Photos ===== | ===== Photos ===== | ||
- | Code pour afficher | + | Quelques moments d' |
- | < | + | {{gallery> |