Problème d'affichage moniteur série Arduino V3.1

Bonjour, J'ai recu des cartes (Clone) Arduino Nano V3.1, et j'ai plusieurs problèmes :

Problème n°1 : avec mon moniteur série, il m'affiche des caractère incompréhensible

Problème n°2 : montage avec une carte RFID
Le téléversement se passe sans soucis, mais cela ne fonctionne pas.
La L clignote très lentement, et le badge n'est pas lu.

J'ai essayé avec une autre carte que je possédait déjà, et ca fonctionne sans problème avec celle-ci, tout comme le moniteur série.

Je vous joins une photo des 2 cartes, ainsi que le code utilisé dans un second poste.

Code :

`[Code]/**

  • "Object Placement" Puzzle
  • This puzzle requires the player to place one or more items in the
  • correct location, at which point an RFID tag embedded in the object
  • is detected by a sensor.
  • When all sensors read the tag of the correct object, the puzzle is solved.
  • Demonstrates:
    • SPI interface shared between several devices
    • RFID library
      */

// DEFINES
// Provides debugging information over serial connection if defined
#define DEBUG

// LIBRARIES
// Standard SPI library comes bundled with the Arduino IDE
#include <SPI.h>
// Download and install from GitHub - miguelbalboa/rfid: Arduino RFID Library for MFRC522
#include <MFRC522.h>

// CONSTANTS
// The number of RFID readers
const byte numReaders = 1;
// Each reader has a unique Slave Select pin
const byte ssPins[] = {7};
// They'll share the same reset pin
const byte resetPin = 8;
// This pin will be driven LOW to release a lock when puzzle is solved
const byte lockPin = 9;
// The sequence of NFC tag IDs required to solve the puzzle
const String correctIDs[] = {"eb2bab1b"};

// GLOBALS
// Initialise an array of MFRC522 instances representing each reader
MFRC522 mfrc522[numReaders];
// The tag IDs currently detected by each reader
String currentIDs[numReaders];

/**

  • Initialisation
    */
    void setup() {

#ifdef DEBUG
// Initialise serial communications channel with the PC
Serial.begin(9600);
Serial.println(F("Serial communication started"));
#endif

// Set the lock pin as output and secure the lock
pinMode(lockPin, OUTPUT);
digitalWrite(lockPin, HIGH);

// Initialise the SPI bus
SPI.begin();

for (uint8_t i=0; i<numReaders; i++) {

// Initialise the reader
// Note that SPI pins on the reader must always be connected to certain
// Arduino pins (on an Uno, MOSI=> pin11, MISO=> pin12, SCK=>pin13)
// The Slave Select (SS) pin and reset pin can be assigned to any pin
mfrc522[i].PCD_Init(ssPins[i], resetPin);

// Set the gain to max - not sure this makes any difference...
// mfrc522[i].PCD_SetAntennaGain(MFRC522::PCD_RxGain::RxGain_max);

#ifdef DEBUG
// Dump some debug information to the serial monitor
Serial.print(F("Reader #"));
Serial.print(i);
Serial.print(F(" initialised on pin "));
Serial.print(String(ssPins[i]));
Serial.print(F(". Antenna strength: "));
Serial.print(mfrc522[i].PCD_GetAntennaGain());
Serial.print(F(". Version : "));
mfrc522[i].PCD_DumpVersionToSerial();
#endif

// Slight delay before activating next reader
delay(100);

}

#ifdef DEBUG
Serial.println(F("--- END SETUP ---"));
#endif
}

/**

  • Main loop
    */
    void loop() {

// Assume that the puzzle has been solved
boolean puzzleSolved = true;

// Assume that the tags have not changed since last reading
boolean changedValue = false;

// Loop through each reader
for (uint8_t i=0; i<numReaders; i++) {

// Initialise the sensor
mfrc522[i].PCD_Init();

// String to hold the ID detected by each sensor
String readRFID = "";

// If the sensor detects a tag and is able to read it
if(mfrc522[i].PICC_IsNewCardPresent() && mfrc522[i].PICC_ReadCardSerial()) {
  // Extract the ID from the tag
  readRFID = dump_byte_array(mfrc522[i].uid.uidByte, mfrc522[i].uid.size);
}

// If the current reading is different from the last known reading
if(readRFID != currentIDs[i]){
  // Set the flag to show that the puzzle state has changed
  changedValue = true;
  // Update the stored value for this sensor
  currentIDs[i] = readRFID;
}

// If the reading fails to match the correct ID for this sensor 
if(currentIDs[i] != correctIDs[i]) {
  // The puzzle has not been solved
  puzzleSolved = false;
}

// Halt PICC
mfrc522[i].PICC_HaltA();
// Stop encryption on PCD
mfrc522[i].PCD_StopCrypto1(); 

}

#ifdef DEBUG
// If the changedValue flag has been set, at least one sensor has changed
if(changedValue){
// Dump to serial the current state of all sensors
for (uint8_t i=0; i<numReaders; i++) {
Serial.print(F("Reader #"));
Serial.print(String(i));
Serial.print(F(" on Pin #"));
Serial.print(String((ssPins[i])));
Serial.print(F(" detected tag: "));
Serial.println(currentIDs[i]);
}
Serial.println(F("---"));
}
#endif

// If the puzzleSolved flag is set, all sensors detected the correct ID
if(puzzleSolved){
onSolve();
}

// Add a short delay before next polling sensors
//delay(100);
}

/**

  • Called when correct puzzle solution has been entered
    */
    void onSolve(){

#ifdef DEBUG
// Print debugging message
Serial.println(F("Puzzle Solved!"));
#endif

// Release the lock
digitalWrite(lockPin, LOW);

while(true) {
delay(1000);
}

}

/**

  • Helper function to return a string ID from byte array
    */
    String dump_byte_array(byte *buffer, byte bufferSize) {
    String read_rfid = "";
    for (byte i=0; i<bufferSize; i++) {
    read_rfid = read_rfid + String(buffer[i], HEX);
    }
    return read_rfid;
    }
    [/CODE]

Quelqu'un a t'il déjà eu le problème avec ce genre de carte ?
J'ai bien sur déjà changé les affichage Baud de 9600 à 115200 sur le scrip et le moniteur, mais rien n'y fait.
Merci d'avance pour votre aide.

:warning:
Post mis dans la mauvaise section, on parle anglais dans les forums généraux. déplacé vers le forum francophone.

Merci de prendre en compte les recommandations listées dans Les bonnes pratiques du Forum Francophone

Cartes utilisées :
C'est celle de droite qui pose problème.

Bonjour,
Désolé je n'avais pas vu le forum francophone. J'ai vu que vous l'aviez déjà déplacé, merci.

utilisez les balises de code... merci

Bonjour.
Il y a sûrement deux raisons : la première c'est que le câble ne peux pas supporter autant de données en si peu de temps, ou moins probable, l'RFID perturbe le câble s'il est très proche. Pour régler ça, laissez un petit intervalle de temps entre deux messages, ou espacez plus le câble et l'RFID, ou enfin baissez encore plus les bauds, dans Serial.begin(9600);.

allons bon... vous nous en dites plus ?

Bonjour Prestidjtation

Premièrement, reprends ton article et mets ton code entre les balises idoines:
image
ou [CODE] au début et [/CODE] à la fin. A voir tu as bien mis des balises, mais pas les bonnes.

Vérifies bien que
image
coresponde avec Serial.begin(9600);Ces 2 valeurs doivent être identiques.

Si c'est le cas, essaies ceci:
void setup() {
	Serial.begin(9600);

    Serial.println("Bonjour Prestidjtation");
}

est ce que ça s'affiche convenablement, si non, donnes un raccourci où tu as acheté ce Nano.

Cela dit, tu as peut être des bits qui ont été escamotés, pas étonnant, avec un pseudo comme le tien :rofl:

Cordialement
jpbbricole

Sur la carte à droite on ne voit pas de référence sur le microcontrôleur.
Qu'y-a-t-il d'indiqué dessus?

Merci pour vos réponses.
Sur le microprocesseur il n'y a rien de marqué.
J'avais déjà essayé même le plus basique des code pour le moniteur série, mais rien n'y fait.
J'ai donc contacté le vendeur qui m'a juste répondu : "Elle ne sont peut être pas compatibles, donc il faut nous les retourner."

C'est cà d'acheter des lots de carte sur les plateformes.
Evitez la marque Ginorgee qui fait des clones arduino de très mauvaise qualitée.

Merci pour le temps passé.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.