Erreur

bonsoir,

j'ai réalisé mon programme arduino me met

"exit status 1
stray '\303' in program"

pour la ligne suivante : " else if (jupeàfleurs_card) Serial.println ("jupe a fleurs"); " je ne comprend pas quel est le problème

bonne fin de soirée

hello :slight_smile:

tout commence là

Bonjour,

Les noms de variables, fonction doivent être en ASCII, c'est à dire qu'ils ne doivent pas avoir de caractères accentués.
Changer jupeàfleurs_card en jupeafleurs_card

"exit status 1
invalid types 'boolean {aka bool}[int]' for array subscript"

if (data != jupeafleurs ) jupeafleurs_card = false;
il m'écrit ça pour cette phrase

mets nous ton code, nous gagnerons du temps

jupeàfleurs_card est 'il déclaré Boolean ?

byte data[5]; //For holding the ID we receive
int val = 0;
byte roberouge[5]= {0x3E,0x00,0xFC,0xBD,0x88};//numéro carte Robe Rouge: 3E00FCBD88
byte jeanshomme [5] = {0x3E,0x00,0xFC,0xFF,0xA5};// Numéro carte Jeans Homme: 3E00FCFFA5
byte jupeafleurs [5] = {0x3E,0x00,0xFC,0xFF,0xA5}; //Numéro carte Jupe à Fleurs :

void setup()
{
// Start serial port 19200 bps
Serial.begin(19200);

// Setting Auto Read Mode - EM4102 Decoded Mode - No password
// command: FF 01 09 87 01 03 02 00 10 20 30 40 37
Serial.write(0xFF); //Header
Serial.write(0x01); //Reserved
Serial.write(0x09); //Length (Command + Data)
Serial.write(0x87); //Command (0x87 sets auto mode behavior
Serial.write(0x01); //Data 1: Enable Auto-Read
Serial.write(0x03); //Data 2: Mode – Parity decoded – Manchester RF/64
Serial.write(0x02); //Data 3: Total number of block to be read (2)
Serial.write((byte)0x00); //Data 4: No password expected
Serial.write(0x10); //Data 5: Password byte 1
Serial.write(0x20); //Data 6: Password byte 2
Serial.write(0x30); //Data 7: Password byte 3
Serial.write(0x40); //Data 8: Password byte 4
Serial.write(0x37); //Checksum

delay(500);
while(Serial.available()>0)
{
Serial.read();
}
Serial.println();
Serial.println("RFID module started in Auto Read Mode, Waiting for Card...");
}

void loop()
{

val = Serial.read();
while (val != 0xff)
{ //On Successful read, first byte will always be 0xFF
val = Serial.read();
delay(1000);
}

//we already read the header (0xff)
Serial.read(); // reserved
Serial.read(); // length
Serial.read(); // command (indicates tag data)
data[0] = Serial.read(); // we read data 1
data[1] = Serial.read(); // we read data 2
data[2] = Serial.read(); // we read data 3
data[3] = Serial.read(); // we read data 4
data[4] = Serial.read(); // we read data 5
Serial.read(); // checksum

// Indentify RFID Card
boolean roberouge_card = true;
boolean jeanshomme = true;
boolean jupeafleurs = true ;
Serial.print("Card found - Code: ");
for (int i=0; i<5; i++)
{
if (data < 16) Serial.print("0");
_ Serial.print(data*, HEX);*_

* //cross-check*
if (data != roberouge*) roberouge_card = false;
if (data != jupeafleurs ) jupeafleurs_card = false;
_ Serial.println();*_

* if (roberouge_card) Serial.println("robe rouge!"); // pour écrire qu'il s'agit d'une robe rouge sur l'écran LCD*
* else if (jupeafleurs_card) Serial.println ("jupe a fleurs");
_ Serial.println();
}*_

tu n'as pas lu la façon de poster du code, c'est pas bien
testes ce code
c'est le tiens revu, j'ai signalé les modifications par "//µµµµµµµµµµµµµµµ"

byte data[5];  //For holding the ID we receive
 int val = 0;
 byte roberouge[5]= {0x3E,0x00,0xFC,0xBD,0x88};//numéro carte Robe Rouge: 3E00FCBD88
 byte jeanshomme [5]  = {0x3E,0x00,0xFC,0xFF,0xA5};// Numéro carte Jeans Homme: 3E00FCFFA5
 byte jupeafleurs_card [5] = {0x3E,0x00,0xFC,0xFF,0xA5}; //Numéro carte Jupe à Fleurs :
 
 void setup()
 {
   // Start serial port 19200 bps
   Serial.begin(19200);
   
   // Setting Auto Read Mode - EM4102 Decoded Mode - No password
   // command: FF 01 09 87 01 03 02 00 10 20 30 40 37
   Serial.write(0xFF);  //Header
   Serial.write(0x01);  //Reserved
   Serial.write(0x09);  //Length (Command + Data)
   Serial.write(0x87);  //Command (0x87 sets auto mode behavior
   Serial.write(0x01);  //Data 1: Enable Auto-Read
   Serial.write(0x03);  //Data 2: Mode - Parity decoded - Manchester RF/64
   Serial.write(0x02);  //Data 3: Total number of block to be read (2)
   Serial.write((byte)0x00);  //Data 4: No password expected
   Serial.write(0x10);  //Data 5: Password byte 1
   Serial.write(0x20);  //Data 6: Password byte 2
   Serial.write(0x30);  //Data 7: Password byte 3
   Serial.write(0x40);  //Data 8: Password byte 4
   Serial.write(0x37);  //Checksum
   
   delay(500);
   while(Serial.available()>0)
   {
     Serial.read();
   }
   Serial.println();
   Serial.println("RFID module started in Auto Read Mode, Waiting for Card...");
 }

 void loop()
 {
 
   val = Serial.read();
   while (val != 0xff)
   {  //On Successful read, first byte will always be 0xFF
      val = Serial.read();
      delay(1000);
   }
   
   //we already read the header (0xff)
   Serial.read();              // reserved
   Serial.read();              // length
   Serial.read();              // command (indicates tag data)
   data[0] = Serial.read();    // we read data 1
   data[1] = Serial.read();    // we read data 2
   data[2] = Serial.read();    // we read data 3
   data[3] = Serial.read();    // we read data 4
   data[4] = Serial.read();    // we read data 5
   Serial.read();              // checksum
   
   // Indentify RFID Card
   boolean roberouge_card = true;
   boolean jeanshomme = true;
   boolean jupeafleurs = true ;
   
   
   Serial.print("Card found - Code: ");
   for (int i=0; i<5; i++) //µµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµ
   {
     if (data [i]< 16) Serial.print("0");//µµµµµµµµµµµµµµµµµµµµµµµµµµ
     Serial.print(data [i], HEX);
     
     //cross-check
     if (data[i] != roberouge[i]) roberouge_card = false;//µµµµµµµµµµµµµµµµµµµµµµµµµµ
     if (data[i] != jupeafleurs_card[i] )jupeafleurs  = false;//µµµµµµµµµµµµµµµµµµµµµµµµµµ

   Serial.println();
   
   if (roberouge_card) Serial.println("robe rouge!"); // pour écrire qu'il s'agit d'une robe rouge sur l'écran LCD
   else if (jupeafleurs_card) Serial.println ("jupe a fleurs");
   Serial.println();
 }
 }//µµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµ

je ne comprend pas ce que vous avez changé appart les commentaires

Moi j'ai vu :grin:

Première correction tu as écrit :

 if (data < 16) Serial.print("0");

et dfgh a corrigé en :

if (data [i]< 16) Serial.print("0");

La suite je te laisse faire.

Sur mon programme c'était déjà écrit de cette manière je ne comprend pas pourquoi en copiant collant cela a changé.. je ne trouve pas le reste

"if (data != roberouge*) roberouge_card = false;//µµµµµµµµµµµµµµµµµµµµµµµµµµ*
if (data != jupeafleurs_card )jupeafleurs = false;//µµµµµµµµµµµµµµµµµµµµµµµµµµ"
pourquoi ne pas écrire la même chose à ces deux lignes???

:slight_smile:

ca, c'est ton code
"if (data != roberouge) roberouge_card = false;//µµµµµµµµµµµµµµµµµµµµµµµµµµ
if (data != jupeafleurs_card )jupeafleurs = false;//µµµµµµµµµµµµµµµµµµµµµµµµµµ"

ça c'est ton code modifié
if (data != roberouge*) roberouge_card = false;//µµµµµµµµµµµµµµµµµµµµµµµµµµ*
if (data != jupeafleurs_card )jupeafleurs = false;//µµµµµµµµµµµµµµµµµµµµµµµµµµ
ce n'est pas la même chose que ce tu nous met au dessus :slight_smile:
je passe la main, à qui veut bien prendre la suite

"if (data != jupeafleurs_card )jupeafleurs = false;//µµµµµµµµµµµµµµµµµµµµµµµµµµ"

"exit status 1
'jupeafleurs_card' was not declared in this scope" voici le message d'erreur qu'Arduino me donne

il y a y prob dans l'affichage de ce que je te poste

récupère le code en #6

lui semble bien s'afficher

tu dois y voir des références au tableau data dans ta boucle
et les en post #11 disparaissent dès que je valide le message, mais si j'y retourne et que je l'édite, ils sont bien là!!!!!

ton code en fichier joint

sketch_jan17e.ino (3.01 KB)

Il faut mettre le code entre balise code (bouton </>) sinon certains caractères disparaissent.

@FDN ok, merci :slight_smile: