Hi everyone,
I hope you could help me. I have a PN532 and an Arduino FIO board. My question is How can I connect it? I saw in adafruit web page a tutorial, and a library. But I do not understand. I saw this: http://www.adafruit.com/products/364A a few minutes ago. It seems that there is an intermediaty between the fio and the PN532, and they develop a library to arduino. But it seems to complicated to me. What I mean is, if there is a easiest way to connect both of them. My PN532 has sel0 and sel1 off, the uart mode is selected. Can I use this mode to connect to the fio directly? Is there any sketch example to do it? Because it must work with a baudrate of 115200 8N1 .... but I do not know how to choose this parameters.
I tried the next:
#include "NewSoftSerial.h"
#define SS 5
#define MOSI 4
#define VCC 2
#define GND 3
NewSoftSerial cardSerial(5,4);
void setup() {
cardSerial.begin(115200);
Serial.begin(115200);
Serial.print("probando lector de tarjeta\n");
digitalWrite(VCC, HIGH);
digitalWrite(GND, LOW);
}
void loop() {
cardSerial.print(0x55, BYTE);
cardSerial.print(0x55, BYTE);
cardSerial.print(0x00, BYTE);
cardSerial.print(0xFF, BYTE);
cardSerial.print(0x03, BYTE);
cardSerial.print(0xFD, BYTE);
cardSerial.print(0xD4, BYTE);
cardSerial.print(0x14, BYTE);
cardSerial.print(0x01, BYTE);
cardSerial.print(0x17, BYTE);
cardSerial.print(0x55, BYTE);
if (cardSerial.available()>0){
Serial.print(cardSerial.read(), HEX);
Serial.print("\nleo\n");
}
delay(1000);
}
Evidentely it doesn´t work. I´ve tried to read the datasheet but ... Also I´ve read the library from adafruit to understand how it could work but sadly I am pretty lost.
So I hope you could help me, give me some tips or clues to figure out how make this work.
Thank you for your time
greetings!