Je recherche un expert en Arduino pour m'expliquer et m'aider a faire un montage code pour un projet de dé sonore qui parle (dit les nombres) en plusieurs langues
Je suis totalement perdue
Je recherche un expert en Arduino pour m'expliquer et m'aider a faire un montage code pour un projet de dé sonore qui parle (dit les nombres) en plusieurs langues
Je suis totalement perdue
Tu en trouveras plusieurs ici.
Décris un peu ce que tu as commencer à regarder et les questions concrète que tu te pose.
As tu déjà commencé par chercher des projets similaires ?
projet scolaire ?
(post deleted by author)
Oui, aidez-moi ![]()
Regardez du côté du DFPlayer Mini ou Mini Pro
Tout dépend de l'énoncé. L'ARDUINO peut-il être équipé d'un module MP3 (DFPlayer comme le suggère J-M-L) ou pas ?
Si oui cela suppose l'autorisation d'achat de ce module, à moins que l'établissement ait déjà prévu la chose.
C'est un projet de fin d'année donc pas d'énoncé.
On a choisi de créer un dé parlant.
Je pense que oui pourquoi l'arduino ne pourrait pas y être équiper ?
C'est ce a quoi j'ai pensé mais deja on n'a pas le matériel et je ne sais pas comment ca fonctionne
Ca va tenir environ 15 fichiers ?? le stockage
C'est possible de mettre ca sur une nano et comment le programmer ?
Si tu choisis d'ajouter un DFPLAYER à l'ARDUINO, il faudra ajouter une carte SD de plusieurs Go.
Ce ne sont pas 15 MP3 qui vont remplir la carte SD.
Voilà l'engin :

Et un tutoriel :
https://www.wikidebrouillard.org/wiki/Item:DFPlayer_Lecteur_MP3
Le haut-parleur peut être branché sur le DFPLAYER. Pas besoin d'ampli, il en comporte déjà un de 2W.
Sur une NANO :
https://www.dfrobot.com/blog-1462.html
J'essaie actuellement de faire des bip quand quand j'ai choisi une langue et que c'est allumer
Mais je ne comprends pas pk ca fonctionne pas
Je peux partager mon programme arduino?
Je ne comprends pas le code sur l'association carte nano + SD
Entre balises code (icône </> STP).
#include "Wire.h" // This library allows you to communicate with I2C devices.
const int MPU_ADDR = 0x68; // I2C address of the MPU-6050. If AD0 pin is set to HIGH, the I2C address will be 0x69.
int16_t accelerometer_x, accelerometer_y, accelerometer_z; // variables for accelerometer raw data
int16_t gyro_x, gyro_y, gyro_z; // variables for gyro raw data
int16_t temperature; // variables for temperature data
int x,y,z = 0;
const int bouton1 = 2;
const int bouton2 = 6;
const int onoff = 4;
int ledPin = 7;
String langue = "rien";
bool buttonState = false;
static int etatprec1 = HIGH;
static int etatprec2 = HIGH;
char tmp_str[7]; // temporary variable used in convert function
char* convert_int16_to_str(int16_t i) { // converts int16 to string. Moreover, resulting strings will have the same length in the debug monitor.
sprintf(tmp_str, "%6d", i);
return tmp_str;
}
void setup() {
Serial.begin(9600);
Wire.begin();
Wire.beginTransmission(MPU_ADDR); // Begins a transmission to the I2C slave (GY-521 board)
Wire.write(0x6B); // PWR_MGMT_1 register
Wire.write(0); // set to zero (wakes up the MPU-6050)
Wire.endTransmission(true);
pinMode(ledPin, OUTPUT);
pinMode(bouton1, INPUT_PULLUP);
pinMode(bouton2, INPUT_PULLUP);
pinMode(onoff, INPUT);
Serial.begin(9600);
}
void loop() {
Wire.beginTransmission(MPU_ADDR);
Wire.write(0x3B); // starting with register 0x3B (ACCEL_XOUT_H) [MPU-6000 and MPU-6050 Register Map and Descriptions Revision 4.2, p.40]
Wire.endTransmission(false); // the parameter indicates that the Arduino will send a restart. As a result, the connection is kept active.
Wire.requestFrom(MPU_ADDR, 7*2, true); // request a total of 7*2=14 registers
// "Wire.read()<<8 | Wire.read();" means two registers are read and stored in the same variable
accelerometer_x = Wire.read()<<8 | Wire.read(); // reading registers: 0x3B (ACCEL_XOUT_H) and 0x3C (ACCEL_XOUT_L)
accelerometer_y = Wire.read()<<8 | Wire.read(); // reading registers: 0x3D (ACCEL_YOUT_H) and 0x3E (ACCEL_YOUT_L)
accelerometer_z = Wire.read()<<8 | Wire.read(); // reading registers: 0x3F (ACCEL_ZOUT_H) and 0x40 (ACCEL_ZOUT_L)
temperature = Wire.read()<<8 | Wire.read(); // reading registers: 0x41 (TEMP_OUT_H) and 0x42 (TEMP_OUT_L)
gyro_x = Wire.read()<<8 | Wire.read(); // reading registers: 0x43 (GYRO_XOUT_H) and 0x44 (GYRO_XOUT_L)
gyro_y = Wire.read()<<8 | Wire.read(); // reading registers: 0x45 (GYRO_YOUT_H) and 0x46 (GYRO_YOUT_L)
gyro_z = Wire.read()<<8 | Wire.read(); // reading registers: 0x47 (GYRO_ZOUT_H) and 0x48 (GYRO_ZOUT_L)
/*// the following equation was taken from the documentation [MPU-6000/MPU-6050 Register Map and Description, p.30]
Serial.print(" | aX = "); Serial.print(convert_int16_to_str(accelerometer_x));
Serial.print(" | aY = "); Serial.print(convert_int16_to_str(accelerometer_y));
Serial.print(" | aZ = "); Serial.print(convert_int16_to_str(accelerometer_z));
Serial.print(" | gX = "); Serial.print(convert_int16_to_str(gyro_x));
Serial.print(" | gY = "); Serial.print(convert_int16_to_str(gyro_y));
Serial.print(" | gZ = "); Serial.print(convert_int16_to_str(gyro_z));
Serial.println();*/
int etat1 = digitalRead(bouton1);
int etat2 = digitalRead(bouton2);
if (digitalRead(onoff) == HIGH && buttonState == false) {
Serial.println("Allume");
digitalWrite(ledPin, HIGH);
buttonState = true;
delay(500);
}
if (digitalRead(onoff) == HIGH && buttonState == true) {
Serial.println("Eteint");
digitalWrite(ledPin, LOW);
buttonState = false;
delay(500);
}
if (buttonState == true) {
if (etat1 == LOW && etatprec1 == HIGH && digitalRead(ledPin) == HIGH) {
langue = "Francais";
Serial.print("langue : ");
Serial.print(langue + "\n");
}
etatprec1 = etat1;
if (etat2 == LOW && etatprec2 == HIGH && digitalRead(ledPin) == HIGH) {
langue = "Anglais";
Serial.print("langue : ");
Serial.print(langue + "\n");
}
etatprec2 = etat2;
if (langue != 'rien'){
if (accelerometer_x > 0 && accelerometer_x < 1000 && accelerometer_y > -1000 && accelerometer_y < 0 && accelerometer_z > 14000 && accelerometer_z < 16000) {
int i = 1;
while (i != 0) {
i = i - 1;
tone(8, 294,300);
delay(500);
noTone(8);
}
}
if (accelerometer_x < 500 && accelerometer_x > -500 && accelerometer_y > -17000 && accelerometer_y < -14000 && accelerometer_z > -6000 && accelerometer_z < -1000) {
int i = 2 ;
while (i != 0) {
i = i - 1;
tone(8, 294,300);
delay(500);
noTone(8);
}
}
if (accelerometer_x < -14000 && accelerometer_x > -17000 && accelerometer_y > -1500 && accelerometer_y < 0 && accelerometer_z > -5000 && accelerometer_z < -3000) {
int i = 3;
while (i != 0) {
i = i - 1;
tone(8, 294,300);
delay(500);
noTone(8);
}
}
if (accelerometer_x < 17000 && accelerometer_x > 15000 && accelerometer_y > -2000 && accelerometer_y < 1000 && accelerometer_z > -2000 && accelerometer_z < 2000) {
int i = 4;
while (i != 0) {
i = i - 1;
tone(8, 294,300);
delay(500);
noTone(8);
}
}
if (accelerometer_x < 900 && accelerometer_x > -900 && accelerometer_y > 14000 && accelerometer_y < 20000 && accelerometer_z > -100 && accelerometer_z < 1000) {
int i = 5;
while (i != 0) {
i = i - 1;
tone(8, 294,300);
delay(500);
noTone(8);
}
}
if (accelerometer_x < 4000 && accelerometer_x > 0 && accelerometer_y > 100 && accelerometer_y < 5000 && accelerometer_z > -20000 && accelerometer_z < -17000) {
int i = 6;
while (i != 0) {
i = i - 1;
tone(8, 294,300);
delay(500);
noTone(8);
}
}
// delay
delay(2000);
}
}
}
Ca ne fonctionne pas pour les langues
Que vient faire le MPU-6050 dans l'histoire ?