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/mac_link.cpp

Committer:
yihui
Date:
2013-12-27
Revision:
0:88960f3eeb2c

File content as of revision 0:88960f3eeb2c:


#include "mac_link.h"
#include "PN532_debug.h"

int8_t MACLink::activateAsTarget(uint16_t timeout)
{
	pn532.begin();
	pn532.SAMConfig();
    return pn532.tgInitAsTarget(timeout);
}

bool MACLink::write(const uint8_t *header, uint8_t hlen, const uint8_t *body, uint8_t blen)
{
    return pn532.tgSetData(header, hlen, body, blen);
}

int16_t MACLink::read(uint8_t *buf, uint8_t len)
{
    return pn532.tgGetData(buf, len);
}