upd examples

This commit is contained in:
Rotzbua
2015-12-05 20:26:26 +01:00
parent 2a1794a0a5
commit 5c502136b3
4 changed files with 6 additions and 5 deletions

View File

@@ -95,7 +95,7 @@ void loop() {
byte valueBlockA = 5; byte valueBlockA = 5;
byte valueBlockB = 6; byte valueBlockB = 6;
byte trailerBlock = 7; byte trailerBlock = 7;
byte status; MFRC522::StatusCode status;
byte buffer[18]; byte buffer[18];
byte size = sizeof(buffer); byte size = sizeof(buffer);
long value; long value;
@@ -278,7 +278,7 @@ void dump_byte_array(byte *buffer, byte bufferSize) {
void formatValueBlock(byte blockAddr) { void formatValueBlock(byte blockAddr) {
byte buffer[18]; byte buffer[18];
byte size = sizeof(buffer); byte size = sizeof(buffer);
byte status; MFRC522::StatusCode status;
Serial.print(F("Reading block ")); Serial.println(blockAddr); Serial.print(F("Reading block ")); Serial.println(blockAddr);
status = mfrc522.MIFARE_Read(blockAddr, buffer, &size); status = mfrc522.MIFARE_Read(blockAddr, buffer, &size);

View File

@@ -99,7 +99,7 @@ void loop() {
0x0c, 0x0d, 0x0e, 0x0f // 13, 14, 15, 16 0x0c, 0x0d, 0x0e, 0x0f // 13, 14, 15, 16
}; };
byte trailerBlock = 7; byte trailerBlock = 7;
byte status; MFRC522::StatusCode status;
byte buffer[18]; byte buffer[18];
byte size = sizeof(buffer); byte size = sizeof(buffer);

View File

@@ -80,7 +80,7 @@ boolean try_key(MFRC522::MIFARE_Key *key)
boolean result = false; boolean result = false;
byte buffer[18]; byte buffer[18];
byte block = 0; byte block = 0;
byte status; MFRC522::StatusCode status;
// Serial.println(F("Authenticating using key A...")); // Serial.println(F("Authenticating using key A..."));
status = mfrc522.PCD_Authenticate(MFRC522::PICC_CMD_MF_AUTH_KEY_A, block, key, &(mfrc522.uid)); status = mfrc522.PCD_Authenticate(MFRC522::PICC_CMD_MF_AUTH_KEY_A, block, key, &(mfrc522.uid));

View File

@@ -58,7 +58,8 @@ void loop() {
byte buffer[34]; byte buffer[34];
byte block; byte block;
byte status, len; MFRC522::StatusCode status;
byte len;
Serial.setTimeout(20000L) ; // wait until 20 seconds for input from serial Serial.setTimeout(20000L) ; // wait until 20 seconds for input from serial
// Ask personal data: Family name // Ask personal data: Family name