Grumpy_Mike:
That is one reason why we specifically ask you to post code in code tags, it tells you how in the how to use this forum sticky post.
ok cool I looked it up...
so here is the code that is my problem...
it is pretty messy as it's be kinda re appropriated for several of my little projects.
#include <deprecated.h>
#include <MFRC522.h>
#include <MFRC522Debug.h>
#include <MFRC522Extended.h>
#include <MFRC522Hack.h>
#include <require_cpp11.h>
#include <MFRC522.h>
/*
* RFID-RC522 (SPI connexion)
*
* CARD RC522 Arduino (UNO)
* SDA ----------- 10 (Configurable, see SS_PIN constant)
* SCK ----------- 13
* MOSI ----------- 11
* MISO ----------- 12
* IRQ -----------
* GND ----------- GND
* RST ----------- 9 (onfigurable, see RST_PIN constant)
* 3.3V ----------- 3.3V
*
*/
#include <SPI.h>
#include <MFRC522.h>
#define SS_PIN 10
#define RST_PIN 9
MFRC522 mfrc522(SS_PIN, RST_PIN); // Create MFRC522 instance
MFRC522::StatusCode status; //variable to get card status
byte buffer[18]; //data transfer buffer (16+2 bytes data+CRC)
byte size = sizeof(buffer);
uint8_t pageAddr = 0x06;
void setup() {
Serial.begin(9600); // Initialize serial communications with the PC
SPI.begin(); // Init SPI bus
mfrc522.PCD_Init(); // Init MFRC522 card
Serial.println(F("Sketch has been started!"));
memcpy(buffer,"tree12345678901",16); //Line being written to page six of RFID
}
void loop() {
// Look for new cards
if ( ! mfrc522.PICC_IsNewCardPresent())
return;
// Select one of the cards
if ( ! mfrc522.PICC_ReadCardSerial())
return;
// Write data ***********************************************
for (int i=0; i < 4; i++) {
//data is writen in blocks of 4 bytes (4 bytes per page)
status = (MFRC522::StatusCode) mfrc522.MIFARE_Ultralight_Write(pageAddr+i, &buffer[i*4], 4);
if (status != MFRC522::STATUS_OK) {
Serial.print(F("MIFARE_Read() failed: "));
Serial.println(mfrc522.GetStatusCodeName(status));
return;
}
}
Serial.println(F("MIFARE_Ultralight_Write() OK "));
Serial.println();
mfrc522.PICC_HaltA();
}