Giter VIP home page Giter VIP logo

pn532's Introduction

NFC library

This is an library for PN532 to use NFC technology. It is for NFC Shield and Grove - NFC.

NFC Shield Grove - NFC

Features

To Do

  • To support more than one INFO PDU of P2P communication
  • To read/write NFC Type 4 tag

Getting Started

  • Easy way

    1. Download zip file and extract the 4 folders(PN532, PN532_SPI, PN532_I2C and PN532_HSU) into Arduino's libraries.
    2. Download Don's NDEF library๏ผŒ extract it into Arduino's libraries and rename it to NDEF.
    3. Follow the examples of the two libraries.
  • Git way for Linux/Mac (recommended)

    1. Get PN532 library and NDEF library

       cd {Arduino}\libraries  
       git clone --recursive https://github.com/Seeed-Studio/PN532.git NFC
       ln -s NFC/PN532 ./
       ln -s NFC/PN532_SPI ./
       ln -s NFC/PN532_I2C ./
       ln -s NFC/PN532_HSU ./
       ln -s NFC/NDEF ./
      
    2. Follow the examples of the two libraries

Contribution

It's based on Adafruit_NFCShield_I2C. Seeed Studio rewrite the library to make it easy to support different interfaces and platforms. @Don writes the NDEF library to make it more easy to use. @JiapengLi adds HSU interface. @awieser adds card emulation function.

HSU Interface

HSU is short for High Speed Uart. HSU interface needs only 4 wires to connect PN532 with Arduino, Sensor Shield can make it more easier. For some Arduino boards like Leonardo, DUE, Mega ect, there are more than one Serial on these boards, so we can use this additional Serial to control PN532, HSU uses 115200 baud rate .

To use the Serial1 control PN532, refer to the code below.

	#include <PN532_HSU.h>
	#include <PN532.h>
	
	PN532_HSU pn532hsu(Serial1);
	PN532 nfc(pn532hsu);

	void setup(void)
	{
		nfc.begin();
		//...
	}

If your Arduino has only one serial interface and you want to keep it for control or debugging with the Serial Monitor, you can use the SoftwareSerial library to control the PN532 by emulating a serial interface. Include PN532_SWHSU.h instead of PN532_HSU.h:

	#include <SoftwareSerial.h>
	#include <PN532_SWHSU.h>
	#include <PN532.h>
	
	SoftwareSerial SWSerial( 10, 11 ); // RX, TX

	PN532_SWHSU pn532swhsu( SWSerial );
	PN532 nfc( pn532swhsu );

	void setup(void)
	{
		nfc.begin();
		//...
	}

pn532's People

Contributors

xiongyihui avatar jiapengli avatar awieser avatar wilson-elechouse avatar alanhortz avatar don avatar pillar1989 avatar net234 avatar zeelivermorium avatar bigzed avatar justjoheinz avatar jazchen avatar gluca avatar floe avatar baorepo avatar picospuch avatar pleone avatar gilphilbert avatar ugomeda avatar oscherler avatar markelkins avatar pcedison avatar mprokopov avatar luismsilva99 avatar ladyada avatar gelicia avatar biblioeteca avatar johnmclear avatar jlkalberer avatar jvhaarst avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.