Demo NFC

Dependencies:   NDefLib X_NUCLEO_NFC01A1 mbed

Fork of HelloWorld_NFC01A1 by ST

Files at this revision

API Documentation at this revision

Comitter:
giovannivisentini
Date:
Tue Feb 02 16:04:36 2016 +0000
Parent:
13:d408e5eaf98e
Child:
15:9b61a8057933
Commit message:
update docs

Changed in this revision

NDefLib.lib Show annotated file Show diff for this revision Revisions of this file
X_NUCLEO_NFC01A1.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/NDefLib.lib	Mon Feb 01 15:43:24 2016 +0000
+++ b/NDefLib.lib	Tue Feb 02 16:04:36 2016 +0000
@@ -1,1 +1,1 @@
-https://developer.mbed.org/teams/ST-Expansion-SW-Team/code/NDefLib/#01fc5a4b8366
+https://developer.mbed.org/teams/ST-Expansion-SW-Team/code/NDefLib/#030e7ffdf512
--- a/X_NUCLEO_NFC01A1.lib	Mon Feb 01 15:43:24 2016 +0000
+++ b/X_NUCLEO_NFC01A1.lib	Tue Feb 02 16:04:36 2016 +0000
@@ -1,1 +1,1 @@
-https://developer.mbed.org/teams/ST-Expansion-SW-Team/code/X_NUCLEO_NFC01A1/#d07138541feb
+https://developer.mbed.org/teams/ST-Expansion-SW-Team/code/X_NUCLEO_NFC01A1/#9f98eafa2d39
--- a/main.cpp	Mon Feb 01 15:43:24 2016 +0000
+++ b/main.cpp	Tue Feb 02 16:04:36 2016 +0000
@@ -48,7 +48,10 @@
     
     //use default board pinout
     I2C i2cChannel(X_NUCLEO_NFC01A1::DEFAULT_SDA_PIN,X_NUCLEO_NFC01A1::DEFAULT_SDL_PIN);
-    X_NUCLEO_NFC01A1 *nfcNucleo = X_NUCLEO_NFC01A1::Instance(i2cChannel,NULL);
+    X_NUCLEO_NFC01A1 *nfcNucleo = X_NUCLEO_NFC01A1::Instance(i2cChannel,NULL,
+            X_NUCLEO_NFC01A1::DEFAULT_GPO_PIN,X_NUCLEO_NFC01A1::DEFAULT_RF_DISABLE_PIN,
+            X_NUCLEO_NFC01A1::DEFAULT_LED1_PIN,X_NUCLEO_NFC01A1::DEFAULT_LED2_PIN,
+            X_NUCLEO_NFC01A1::DEFAULT_LED3_PIN);
     
     //retrieve the NdefLib interface
     NDefLib::NDefNfcTag& tag =nfcNucleo->getM24SR().getNDefTag();
@@ -56,7 +59,7 @@
     
     //open the i2c session with the nfc chip
     if(tag.openSession()){
-        printf("Session open\n\r");
+        printf("Session opened\n\r");
         nfcNucleo->getLed1()=1;
         
         //create the NDef message and record
@@ -66,7 +69,7 @@
 
         //write the tag
         if(tag.write(msg)){
-            printf("Tag writed \n\r");
+            printf("Tag written\n\r");
             nfcNucleo->getLed2()=1;
         }else{
             printf("Error writing \n\r");
@@ -77,9 +80,9 @@
            printf("Session closed\n\r");
            nfcNucleo->getLed3()=1;
         }else{
-           printf("Error Closing the session\n\r");
+           printf("Error closing the session\n\r");
         }//if-else
             
     }else
-        printf("Error open Session\n\r");
+        printf("Error opening the session\n\r");
 }
\ No newline at end of file