Modifications

Sauter à la navigation Sauter à la recherche
955 octets ajoutés ,  25 juillet 2015 à 19:07
Ligne 5 : Ligne 5 :     
== Installer la bibliothèque ==
 
== Installer la bibliothèque ==
{{bloc-etroit|text=[https://github.com/adafruit/Adafruit-PN532 Download the Adafruit PN532 library from github]. Uncompress the folder and rename the folder '''Adafruit_PN532'''. Inside the folder you should see the '''Adafruit_PN532.cpp''' and '''Adafruit_PN532.h''' files. Install the '''Adafruit_PN532''' library foler by placing it in your '''arduinosketchfolder/libraries''' folder. You may have to create the libraries subfolder if this is your first library. [[Installation d'un librairie Arduino|You can read more about installing libraries in our tutorial]].
+
{{bloc-etroit|text=[https://github.com/adafruit/Adafruit-PN532 Télécharger la bibliothèque Adafruit PN532 depuis GitHub]. Décompressez le répertoire et renommez les répertoire pour qu'il porte le nom '''Adafruit_PN532'''. A l'intérieur du répertoire, vous devriez vois les fichiers '''Adafruit_PN532.cpp''' et '''Adafruit_PN532.h'''. Installez ensuite le répertoire de la bibliothèque '''Adafruit_PN532''' dans votre répertoire '''répertoire_des_croquis_arduino/libraries'''. Vous pourriez avoir besoin de créer le sous répertoire {{fname|libraries}} si c'est la première bibliothèque que vous installez. [[Installation d'un librairie Arduino|Voyez ce tutoriel pour en apprendre plus sur l'installation des bibliothèques Arduino]].
   −
Restart the Arduino IDE. You should now be able to select le croquis/sketch '''Fichier > Exemples > Adafruit_PN532 > readMifare'''.
+
Redemandez votre Arduino IDE. Vous devriez être capable de sélectionner le croquis/sketch d'exemple suivant '''Fichier > Exemples > Adafruit_PN532 > readMifare'''.
   −
'''If you're using the NFC breakout with a SPI connection''' that uses the wiring shown on previous pages you can immediately upload the sketch to the Arduino and skip down to the Testing MiFare section.
+
'''Si vous utilisez le breakout NFC avec la connexion SPI''' (voyez les pages précédentes pour le branchement), vous pouvez téléverser directement le corquis d'exemple dans votre Arduino et passer directement à la section "Tester les tags MiFare" sur cette même page.
   −
'''If you're using the NFC shield, or are using the breakout with an I2C connection''' then you must make a small change to configure the example for I2C.  Scroll down to these lines near the top of the sketch:}}
+
<font color="red">'''Si vous utilisez le shield NFC, ou si vous utilisez le breakout NFC en I2C'''</font> alors vous devez effectuer une petite modification pour faire en sorte que l'exemple utilise le bus I2C.  Explorer les lignes de votre croquis, vous devriez trouver les lignes suivantes près du début du croquis:}}
    
  <nowiki>// Uncomment just _one_ line below depending on how your breakout or shield
 
  <nowiki>// Uncomment just _one_ line below depending on how your breakout or shield
Ligne 28 : Ligne 28 :  
//Adafruit_PN532 nfc(PN532_IRQ, PN532_RESET);</nowiki>
 
//Adafruit_PN532 nfc(PN532_IRQ, PN532_RESET);</nowiki>
   −
Change them so the second line is uncommented and the first line is commented. This will configure the sketch to make the library use I2C for communication with the NFC shield or breakoutThe modified code should look like:
+
Modifier le croquis de sorte que la ligne sous "with SPI connection" soit mise en commentaire ET que la ligne sous "with I2C connection" soit décommentée.
 +
 
 +
Cela configurera le croquis pour que le croquis utilise la bibliothèque avec le bus I2C (pour le shield)Le code modifié devrait ressembler à ceci:
    
  <nowiki>// Uncomment just _one_ line below depending on how your breakout or shield
 
  <nowiki>// Uncomment just _one_ line below depending on how your breakout or shield
Ligne 45 : Ligne 47 :  
Adafruit_PN532 nfc(PN532_IRQ, PN532_RESET);</nowiki>
 
Adafruit_PN532 nfc(PN532_IRQ, PN532_RESET);</nowiki>
   −
Then upload the example to the Arduino and continue on.  '''Note that you need to make a similar change to pick the interface for any other NFC example from the library'''.
+
Téléversez ensuite l'exemple sur votre Arduino et poursuivez votre lecture.  '''Notez que vous aurez besoin de réaliser ce changement pour chacun des exemples proposés dans la bibliothèque'''.
    
== Tester les tags MiFare ==
 
== Tester les tags MiFare ==
In the serial monitor, you should see that it found the '''PN532''' chip. Then you can place your tag nearby and it will display the 4 byte ID code (this one is 0xAE 0x4C 0xF0 0x6C) and then the integer version of all four bytes together. You can use this number to identify each card. Recently NXP made so many cards that they actually ran through all 4 Bytes (2^32) so the number is not guaranteed to be absolutely unique. However, the chances are extremely slim you will have two cards with the same ID so as long as you aren't using these cards for anything terribly important (like money transfer) its fine to use the number as a unique identifier
+
Dans le moniteur série d'Arduino, vous devriez voir que la bibliothèque à trouvé le '''PN532'''. Ensuite, vous pouvez placer un tag près de l'antenne et le programme affichera les 4 octets/bytes du code d'identification (l'ID, celui-ci est 0xAE 0x4C 0xF0 0x6C) et ensuite la version (sous forme d'entier) des 4 bytes ensemble. Vous pouvez utiliser cette information pour identifier chaque carte. NXP à émis tellement de cartes qu'ils ont finit par faire le tour complet des valeurs possibles offert par les 4 octets/bytes de l'ID. Cela représente donc 2^32 cartes (4,294,967,296 cartes). L'ID n'est donc plus garanti comme "absolument unique". Il y a cependant peu de chance que vous puissiez entrer en possession de deux cartes ayant le même ID. D'un point de vue sécuritaire, l'utilisation du seul ID pour identifier une carte n'est pas souhaitable... sauf si votre projet ne met pas des informations sensibles (transaction financière, identification, etc). Hormis ces cas plus sensibles, l'ID peut très bien être utilisé comme identifiant unique (ex: jouet, matériel informatique, etc).
    
{{ADFImage|PN532-RFID-NFC-Arduino-Lib-00.jpg}}
 
{{ADFImage|PN532-RFID-NFC-Arduino-Lib-00.jpg}}
29 918

modifications

Menu de navigation