background image

Documentation Center

/** 
   @file readMifareClassic.ino 
   @author rakwireless.com 
   @brief  This example will wait for any ISO14443A card or tag, and depending on the size of the
   @version 0.1 
   @date 2021-10-14 
   @copyright Copyright (c) 2021 
**/

 

 

#

include

 

<Wire.h>

#

include

 

<SPI.h>

#

include

 

<RAK13600-PN532.h>

 

// Click here to get the library: http://librarymanager/All#RAK13600-

 

// If using the breakout or shield with I2C, define just the pins connected

#

define

 PN532_IRQ   

(

WB_IO6

)

#

define

 PN532_RESET 

(

WB_IO5

)

  

// Not connected by default on the NFC Shield

 

 

// Or use this line for a breakout or shield with an I2C connection:

 

NFC_PN532 

nfc

(

PN532_IRQ

,

 PN532_RESET

);

 

 

void

 

setup

(

void

)

 

{

 

  Serial

.

begin

(

115200

);

 

  

pinMode

(

WB_IO2

,

 OUTPUT

);

 

  

digitalWrite

(

WB_IO2

,

 HIGH

);

 

  

delay

(

300

);

 

  

while

 

(

!

Serial

)

 

delay

(

10

);

 

// for Leonardo/Micro/Zero

 

 
  Serial

.

println

(

"Hello!"

);

 

 
  nfc

.

begin

();

 

 
  

uint32_t

 versiondata 

=

 nfc

.

getFirmwareVersion

();

 

  

if

 

(

!

 versiondata

)

 

{

 

    Serial

.

print

(

"Didn't find PN53x board"

);

 

    

while

 

(

1

);

 

// halt

 

  

}

 

  

// Got ok data, print it out!

 

  Serial

.

print

(

"Found chip PN5"

);

 Serial

.

println

((

versiondata

>>

24

)

 

&

 

0xFF

,

 HEX

);

  

  Serial

.

print

(

"Firmware ver. "

);

 Serial

.

print

((

versiondata

>>

16

)

 

&

 

0xFF

,

 DEC

);

  

  Serial

.

print

(

'.'

);

 Serial

.

println

((

versiondata

>>

8

)

 

&

 

0xFF

,

 DEC

);

 

   
  

// configure board to read RFID tags

 

  nfc

.

SAMConfig

();

 

   
  Serial

.

println

(

"Waiting for an ISO14443A Card ..."

);

}

 

 

void

 

loop

(

void

)

 

{

 

  

uint8_t

 success

;

 

  

uint8_t

 uid

[]

 

=

 

{

 

0

,

 

0

,

 

0

,

 

0

,

 

0

,

 

0

,

 

0

 

};

  

// Buffer to store the returned UID

 

  

uint8_t

 uidLength

;

                        

// Length of the UID (4 or 7 bytes depending on ISO14

     
  

// Wait for an ISO14443A type cards (Mifare, etc.).  When one is found

 

  

// 'uid' will be populated with the UID, and uidLength will indicate

 

  

// if the uid is 4 bytes (Mifare Classic) or 7 bytes (Mifare Ultralight)

 

  success 

=

 nfc

.

readPassiveTargetID

(

PN532_MIFARE_ISO14443A

,

 uid

,

 

&

uidLength

);

 

   
  

if

 

(

success

)

 

{

 

    

// Display some basic information about the card

 

    Serial

.

println

(

"Found an ISO14443A card"

);

 

    Serial

.

print

(

"  UID Length: "

);

Serial

.

print

(

uidLength

,

 DEC

);

Serial

.

println

(

" bytes"

);

 

    Serial

.

print

(

"  UID Value: "

);

 

c

Summary of Contents for WisBlock RAK13600

Page 1: ...odule is designed as wireless module that allows you to scan NFC and RFID tags and devices It includes an antenna coil that transmits and receives RF signals from the object being scanned Without the...

Page 2: ...arefully the procedure defined in WisBlock Base module assembly disassembly instructions to attach a WisBlock module Once attached carefully fix the module with three M1 2 x 3 mm screws compatible wit...

Page 3: ...Figure 6 to detach the module from the baseboard Figure 6 Applying even forces on the proper location of a WisBlock module NOTE If you will connect other modules to the remaining WisBlock Base slots...

Page 4: ...polarity on the RAK WisBlock Base Board Not all batteries have the same wiring Only 5 V solar panels are supported Do not use 12 V solar panels It will destroy the charging unit and eventually other...

Page 5: ...Documentation Center Figure 8 Selecting RAK4631 as WisBlock Core Figure 9 Selecting RAK11200 as WisBlock Core...

Page 6: ...Documentation Center Figure 10 Selecting RAK11300 as WisBlock Core 2 Copy the example code below and paste it on the Arduino IDE...

Page 7: ...getFirmwareVersion if versiondata Serial print Didn t find PN53x board while 1 halt Got ok data print it out Serial print Found chip PN5 Serial println versiondata 24 0xFF HEX Serial print Firmware v...

Page 8: ...PN532 Library 4 You will be directed to the Library Manager then you have to click install nfc PrintHex uid uidLength if uidLength 4 We probably have a Mifare Classic card uint32_t cardid uid 0 cardid...

Page 9: ...t You need to type on the library search box adafruit busio then install it by clicking install After the successful installation of the two libraries you can now close the Library Manager window Figu...

Page 10: ...rt Figure 15 Uploading the sample code If you experience any error in compiling the demo sketch check the updated code for the RAK13600 readMifareClassic example Other example codes for RAK13600 are a...

Page 11: ...heck the full details on the RAK11200 Quick Start Guide 7 When you have successfully uploaded the example code open the serial monitor by clicking the magnifying glass icon on the upper right of the A...

Page 12: ...rts 6 different operating modes ISO IEC 14443A MIFARE Reader Writer FeliCa Reader Writer ISO IEC 14443B Reader Writer ISO IEC 14443A MIFARE Card MIFARE Classic 1K or MIFARE Classic 4K card emulation m...

Page 13: ...e RAK13600 WisBlock NFC Reader has the standard 40 pin WisConnector It is compatible with the IO slot which allows the RAK13600 module to be mounted on a WisBlock baseboard such as RAK5005 O The pin o...

Page 14: ...nical dimensions of the RAK13600 module Figure 3 RAK13600 Mechanical Dimensions WisConnector PCB Layout Parameter Minimum Typical Maximum Unit 3V3_S 2 7 3 3 3 6 V Idvdd Digital Supply Current 25 mA Ia...

Page 15: ...Documentation Center Figure 4 WisConnector PCB footprint and recommendations Schematic Diagram Figure 5 RAK13600 Schematic Diagram Certification...

Page 16: ...Documentation Center Last Updated 8 5 2022 4 34 30 AM...

Reviews: