Hi all,
Love the MKR1000 so far. I'm finding it quite a nice little board.
shortly describe about my project its rfid attendance system . at my previous version i use ESP8266 for collect data and send to server.
Now I relay want to use MKR1000 as main controller . so I am trying to code with this MKR1000.
from very first test code working normally as expected . also connect my spi oled with MKR1000 and last night its working fine.
basically I am using spi protocol to communicate MKR1000 and RFID READER RC522. Use stander pin of MKR1000 and define rst and ss pin.
problem :- when I upload my sketch MKR1000 stop recognise . no port present after upload my sketch. it return Boot loader mode.
so i don't understand what happing there . pin instruction may be coses of that.
#include <SPI.h>
#include "MFRC522.h"
#define RST_PIN 6 // RST-PIN für RC522 - RFID - SPI - Modul GPIO5
#define SS_PIN 7 // SDA-PIN für RC522 - RFID - SPI - Modul GPIO2
MFRC522 mfrc522(SS_PIN, RST_PIN);
void setup() {
Serial.begin(115200);
delay(100);
SPI.begin(); // Init SPI bus
mfrc522.PCD_Init(); // Init MFRC522
}
int value = 0;
String readIDold;
void loop()
{
// Look for new cards
if ( ! mfrc522.PICC_IsNewCardPresent()) {
delay(50);
return;
}
// Select one of the cards
if ( ! mfrc522.PICC_ReadCardSerial()) {
delay(50);
return;
}
// Show some details of the PICC (that is: the tag/card)
Serial.print(F("Card UID:"));
// dump_byte_array(mfrc522.uid.uidByte, mfrc522.uid.size);
Serial.println();
String readID = "s";
for (byte i = 0; i < mfrc522.uid.size; i++) {
readID += mfrc522.uid.uidByte[i];
}
}
// Helper routine to dump a byte array as hex values to Serial
void dump_byte_array(byte *buffer, byte bufferSize) {
for (byte i = 0; i < bufferSize; i++) {
Serial.print(buffer[i] < 0x10 ? " 0" : " ");
Serial.print(buffer[i], HEX);
}
}