NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

#include <SPI.h>
#include <MFRC522.h>
#include <SD.h>
#include <virtuabotixRTC.h>
virtuabotixRTC Saat(25, 33, 32);
String saatString, tarihString, logg, isim, path, userName;
String veri, cardID;
bool bulundu = false;

#define SS_PIN 5
#define RST_PIN 4
#define SD_CS_PIN 21
#define ONAY_PIN 26
#define RED_PIN 27
#define MLT_PIN 14
#define Status_PIN 16

/*USER IDs*/

MFRC522 mfrc522(SS_PIN, RST_PIN);
File myLog;
File myUser;

void setup() {

pinMode(ONAY_PIN, OUTPUT);
pinMode(RED_PIN, OUTPUT);
pinMode(MLT_PIN, OUTPUT);
digitalWrite(RED_PIN, LOW);
digitalWrite(ONAY_PIN, LOW);
digitalWrite(MLT_PIN, 1);
delay(100);
digitalWrite(MLT_PIN, 0);
Serial.begin(115200);
SPI.begin();



if (!SD.begin(SD_CS_PIN)) {
Serial.println("SD kart okuyucusu bağlantısı başarısız!");
return;
}
Serial.println("SD kart okuyucusu bağlandı.");
mfrc522.PCD_Init();
}

void loop() {
if (mfrc522.PICC_IsNewCardPresent() && mfrc522.PICC_ReadCardSerial()) {
String cardID = "";

for (byte i = 0; i < mfrc522.uid.size; i++) {

cardID += String(mfrc522.uid.uidByte[i] < 0x10 ? "0" : "");

cardID += String(mfrc522.uid.uidByte[i], HEX);

if (i < mfrc522.uid.size - 1) {
cardID += " ";
}
}
Serial.println("Kart ID: " + cardID);


String path = String("/users/") + String(cardID) + String(".txt");
myUser = SD.open(path);
if (myUser) {
userName = String(myUser.readStringUntil('n'));
Serial.println(userName);
logtut(userName, cardID);
onay();
myUser.close();
ESP.restart();
}
else {
Serial.println("Kullanıcı Bulunamadı");
logtut("KAYITDISI", cardID);
red();
myUser.close();
ESP.restart();
}
}

}




String saatial() {

String hour, minute, seconds;

Saat.updateTime();

if (Saat.hours < 10) {
hour = "0" + String(Saat.hours);
} else {
hour = String(Saat.hours);
}

if (Saat.minutes < 10) {
minute = "0" + String(Saat.minutes);
} else {
minute = String(Saat.minutes);
}

if (Saat.seconds < 10) {
seconds = "0" + String(Saat.seconds);
} else {
seconds = String(Saat.seconds);
}
saatString = String(hour) + String(":") + String(minute) + String(":") + String(seconds);
return saatString;
}

String tarihial() {

String day, mon;

Saat.updateTime();

if (Saat.dayofmonth < 10) {
day = "0" + String(Saat.dayofmonth);
} else {
day = String(Saat.dayofmonth);
}

if (Saat.month < 10) {
mon = "0" + String(Saat.month);
} else {
mon = String(Saat.month);
}

tarihString = String(day) + String(".") + String(mon) + String(".") + String(Saat.year);
return tarihString;
}

void onay() {
Serial.print("ONAY ");
Serial.println(saatial());
digitalWrite(ONAY_PIN, HIGH);
delay(3000);
digitalWrite(ONAY_PIN, LOW);
}

void red() {
Serial.print("RED ");
Serial.println(saatial());
digitalWrite(RED_PIN, HIGH);
delay(200);
digitalWrite(RED_PIN, LOW);
}

void logtut(String isim, String id) {
String path = String("/log/") + String(tarihial()) + String(".txt");
myLog = SD.open( path , FILE_APPEND);
if (myLog) {
Serial.print("Log tutuluyor");
myLog.print(saatial());
myLog.print(",");
myLog.print(isim);
myLog.print(",");
myLog.println(id);
myLog.close();
Serial.println("ok");
digitalWrite(MLT_PIN, 1);
delay(50);
digitalWrite(MLT_PIN, 0);



} else {
// if the file didn't open, print an error:
Serial.println("hata oluştu");
}
}
     
 
what is notes.io
 

Notes.io is a web-based application for 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 12 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

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.