Last active
December 17, 2015 10:48
-
-
Save don/5597085 to your computer and use it in GitHub Desktop.
Code for NFC slides - Maker Faire Bay Area 2013
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd ~/Documents/Arduino/libraries | |
git clone git@github.com:adafruit/Adafruit_NFCShield_I2C.git | |
git clone git@github.com:don/Ndef.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NfcAdapter nfc = NfcAdapter(); | |
void setup(void) { | |
nfc.begin(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (nfc.tagPresent()) { | |
NdefMessage message = NdefMessage(); | |
message.addTextRecord("hello, world"); | |
nfc.write(message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (nfc.tagPresent()) { | |
NfcTag tag = nfc.read(); | |
tag.print(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment