Good evening guys (first of all, sorry, i know that my english is bad),
I am having some problems with Arduino UNO, all works great but now, looking into internet, i found this code:
//Módulo Lector RFID-RC522 RF
#include <SPI.h>
#include <MFRC522.h>
RFID rfid(10,5);
void setup()
{
Serial.begin(9600);
SPI.begin(); rfid.init();
}
unsigned char het[16]={'H','E','T','P','R','O',' ','R','F','I','D',' ','5','5','2',' '}; //Declaracion de cadena de caracteres
unsigned char *writeData=het; //asigna het a char tipo puntero
unsigned char *str; //char tipo puntero utilizado para la función de lectura de un bloque
void loop()
{
if (rfid.isCard()) {
rfid.write(8,writeData); //Función escritura (num de bloque, string)
rfid.read(8,str); //Función lectura (num de bloque, str) guarda lo que está en el bloque a str
Serial.print(str[0]); //Imprime lo que se guardó en str de la funcion read
}
rfid.halt();
}
And getting this errors:
LecturaBloqTags_RFID:4: error: 'RFID' does not name a type
RFID rfid(10,5);
^
/Users/jorgevega/Documents/Arduino/LecturaBloqTags_RFID/LecturaBloqTags_RFID.ino: In function 'void setup()':
LecturaBloqTags_RFID:8: error: 'rfid' was not declared in this scope
SPI.begin(); rfid.init();
^
/Users/jorgevega/Documents/Arduino/LecturaBloqTags_RFID/LecturaBloqTags_RFID.ino: In function 'void loop()':
LecturaBloqTags_RFID:17: error: 'rfid' was not declared in this scope
if (rfid.isCard()) {
^
LecturaBloqTags_RFID:22: error: 'rfid' was not declared in this scope
rfid.halt();
^
exit status 1
'RFID' does not name a type
What can be? I believe that I know how to add a library perfectly, but will never know… Can someone help me? Thanks for all.
PD: In the code, RFID made reference to this library: GitHub - pkourany/RC522_RFID: RC522_RFID library ported to Spark Core with added support for Software SPI