This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int readBlock(int blockNumber, byte arrayAddress[]) { | |
int largestModulo4Number=blockNumber/4*4; | |
int trailerBlock=largestModulo4Number+3;//determine trailer block for the sector | |
/*****************************************authentication of the desired block for access***********************************************************/ | |
byte status = scanner.PCD_Authenticate(MFRC522::PICC_CMD_MF_AUTH_KEY_A, trailerBlock, &key, &(scanner.uid)); | |
if (status != MFRC522::STATUS_OK) { | |
//Serial.print("PCD_Authenticate() failed (read): "); | |
//Serial.println(scanner.GetStatusCodeName(status)); | |
skrivFeilmld(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Adafruit_NeoPixel.h> | |
#include <LiquidCrystal.h> | |
#include <SPI.h>//include the SPI bus library | |
#include <MFRC522.h>//include the RFID reader library | |
#define SS_PIN 10 //slave select pin | |
#define RST_PIN 9 //reset pin | |
String name; //ID of the RFID-card | |
int block=2; //this is the block number we will read. |