to colorize a colorful pixel with a simple touch using nfc technology
Dependencies: Chainable_RGB_LED mbed
use Arch, NFC Shield and Grove - Chainable RGB LED to DIY a touch pixel. Then use an Android with NFC support to colorize it.
The project is on https://github.com/Seeed-Studio/TouchPixel
nfc/MifareClassic.h@0:88960f3eeb2c, 2013-12-27 (annotated)
- Committer:
- yihui
- Date:
- Fri Dec 27 01:46:32 2013 +0000
- Revision:
- 0:88960f3eeb2c
initial
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
yihui | 0:88960f3eeb2c | 1 | #ifndef MifareClassic_h |
yihui | 0:88960f3eeb2c | 2 | #define MifareClassic_h |
yihui | 0:88960f3eeb2c | 3 | |
yihui | 0:88960f3eeb2c | 4 | #include <PN532.h> |
yihui | 0:88960f3eeb2c | 5 | #include <Ndef.h> |
yihui | 0:88960f3eeb2c | 6 | #include <NfcTag.h> |
yihui | 0:88960f3eeb2c | 7 | |
yihui | 0:88960f3eeb2c | 8 | class MifareClassic |
yihui | 0:88960f3eeb2c | 9 | { |
yihui | 0:88960f3eeb2c | 10 | public: |
yihui | 0:88960f3eeb2c | 11 | MifareClassic(PN532& nfcShield); |
yihui | 0:88960f3eeb2c | 12 | ~MifareClassic(); |
yihui | 0:88960f3eeb2c | 13 | NfcTag read(uint8_t *uid, unsigned int uidLength); |
yihui | 0:88960f3eeb2c | 14 | bool write(NdefMessage& ndefMessage, uint8_t *uid, unsigned int uidLength); |
yihui | 0:88960f3eeb2c | 15 | private: |
yihui | 0:88960f3eeb2c | 16 | PN532* _nfcShield; |
yihui | 0:88960f3eeb2c | 17 | int getBufferSize(int messageLength); |
yihui | 0:88960f3eeb2c | 18 | int getNdefStartIndex(uint8_t *data); |
yihui | 0:88960f3eeb2c | 19 | bool decodeTlv(uint8_t *data, int &messageLength, int &messageStartIndex); |
yihui | 0:88960f3eeb2c | 20 | }; |
yihui | 0:88960f3eeb2c | 21 | |
yihui | 0:88960f3eeb2c | 22 | #endif |