Notes
Notes - notes.io |
#include <MFRC522.h>
#include <EEPROM.h>
#define RST_PIN 9
#define SS_PIN 10byte readCard[4];
int successRead;MFRC522 mfrc522(SS_PIN, RST_PIN);
MFRC522::MIFARE_Key key;
void setup()
{ Serial.begin(9600);
SPI.begin(); mfrc522.PCD_Init();
Serial.println(“RFID KART KAYIT UYGULAMASI”);
Serial.println(“————————–“);
Serial.println(“Lutfen 1 numarali karti okutun”);
Serial.println();
do
{ successRead = getID(); }
while (!successRead);
for ( int i = 0; i < mfrc522.uid.size; i++ ) {
EEPROM.write(i, readCard[i] ); }
Serial.println(“Kart EEPROM’a kaydedildi.”); Serial.println(); Serial.println(“Lutfen 2 numarali karti okutun.”);
Serial.println();
do { successRead = getID(); }
while (!successRead);
for ( int i = 0; i < mfrc522.uid.size; i++ )
{ EEPROM.write(i + 4, readCard[i] ); }
Serial.println(“Kart EEPROM’a kaydedildi.”);
Serial.println();
Serial.println(“Kart kayit islemi basarili!”);}
void loop(){}
int getID() {
if ( ! mfrc522.PICC_IsNewCardPresent()) { return 0; }
if ( ! mfrc522.PICC_ReadCardSerial()) { return 0; }
Serial.print(“Kart UID’si: “);
for (int i = 0; i < mfrc522.uid.size; i++) { //
readCard[i] = mfrc522.uid.uidByte[i];
Serial.print(readCard[i], HEX); }
Serial.println(“”); (okuma başarılı)
mfrc522.PICC_HaltA(); return 1;}
}
}
}
#include <SPI.h>
#include <MFRC522.h>
#include <EEPROM.h>
#define RST_PIN 9
#define SS_PIN 10
#define ledPin 7MFRC522 mfrc522(SS_PIN, RST_PIN);
String lastRfid = “”;String kart1 = “”;
String kart2 = “”;MFRC522::MIFARE_Key key;
void setup()
{ Serial.begin(9600);
SPI.begin(); mfrc522.PCD_Init();
pinMode(ledPin, OUTPUT);
Serial.println(“RFID KART OKUMA UYGULAMASI”);
Serial.println(“————————–“);
Serial.println();
readEEPROM();}
void loop(){
if ( ! mfrc522.PICC_IsNewCardPresent()) { return; }
if ( ! mfrc522.PICC_ReadCardSerial()) { return; }
String rfid = “”;
for (byte i = 0; i < mfrc522.uid.size; i++)
{ rfid += mfrc522.uid.uidByte[i] < 0x10 ? ” 0″ : ” “;
rfid += String(mfrc522.uid.uidByte[i], HEX);
}
rfid.trim();
rfid.toUpperCase();
if (rfid == lastRfid)
return;
lastRfid = rfid;
Serial.print(“Kart 1: “);
Serial.println(kart1);
Serial.print(“Kart 2: “);
Serial.println(kart2);
Serial.print(“Okunan: “);
Serial.println(rfid);
Serial.println();
if (rfid == kart1) { digitalWrite(ledPin, HIGH);
Serial.println(“LED yandi.”); }
if (rfid == kart2)
{ digitalWrite(ledPin, LOW);
Serial.println(“LED sondu.”);
}
Serial.println();
delay(200);}
void readEEPROM(){
for (int i = 0 ; i < 4 ; i++)
{ kart1 += EEPROM.read(i) < 0x10 ? ” 0″ : ” “;
kart1 += String(EEPROM.read(i), HEX);
}
for (int i = 4 ; i < 8 ; i++)
{ kart2 += EEPROM.read(i) < 0x10 ? ” 0″ : ” “;
kart2 += String(EEPROM.read(i), HEX);
}
kart1.trim();
kart1.toUpperCase();
kart2.trim();
kart2.toUpperCase();
}
}
|
Notes is a web-based application for online taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000+ notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 14 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team