Hi, I would like know if someone know how can I connect a RFID tarjet with my Ethernet shield, the problem that i see is that using a programm that is only using the RFID, but i have connected all, with the pins MISO,MOSI,SCK that are the same, the pin SS of ehternet is 10 and the SS of my RFID is the 7, the arduino don't read the RFID card.
Also I put in high and low the SS corresponding pins.
In my programm that i want do, connected all, only work my ethernet shield, the rfid do like if it isn't there.
//GeekChickens
//http://geekchickens.blogspot.com.es/
/*
SDA es el pin 10
SCK es el pin 13
MOSI es el pin 11
MISO es el pin 12
RST es el pin 9
*/
//-----------------------------------------------variables, includes, funciones, etc-------------------------------------------------
#include <SPI.h>
#include <RFID.h>
#define SS_PIN 6
#define RST_PIN 7
RFID rfid(SS_PIN, RST_PIN);
int numero_serie[5]; // aqui guardaremos el número que nuestro sensor RFID detectará
//-----------------------------------------------variables, includes,funciones, etc-------------------------------------------------
void setup()
{
Serial.begin(9600);
pinMode (6, OUTPUT);
pinMode (10, OUTPUT);
SPI.begin();
rfid.init();
}
void loop()
{
digitalWrite(10,LOW);
digitalWrite(6,HIGH);
leer_usuario();
}
void leer_usuario()
{
if (rfid.isCard())
{
if (rfid.readCardSerial())
{
Serial.print("Numero usuario: "); // guardamos el numero del usuario
for(int i=0; i<=4 ; i++)
{
numero_serie[i] = rfid.serNum[i];
}
for(int i=0; i<=4 ; i++) // y lo imprimimos
{
Serial.print(numero_serie[i]);
Serial.print(" ");
}
Serial.println(" "); // espacio para el siguiente código
delay(500); // para que no se imprima constantemente el mismo numero
}
}
rfid.halt();
}
I have to say that my ethernet module is the enc28j60 shield, i don't know if this can be the problem.
In a few days a recieve the ethernet shield of w5100 so i will try with this...