Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: NDefLib X_NUCLEO_NFC01A1 mbed
Fork of HelloWorld_NFC01A1 by
Diff: main.cpp
- Revision:
- 14:1b99908360c5
- Parent:
- 11:925a5a491a5c
- Child:
- 17:22e6c00f3a4c
- Child:
- 18:982e7640cfb6
diff -r d408e5eaf98e -r 1b99908360c5 main.cpp
--- 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
