NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

1
2 #include <SPI.h>
3 #include <MFRC522.h>
4
5
6 #define SS_PIN 10
7 #define RST_PIN 9
8 #define LED_G 4 //define green LED pin
9 #define LED_R 5 //define red LED
10 #define BUZZER 2 //buzzer pin
11 MFRC522 mfrc522(SS_PIN, RST_PIN); // Create MFRC522 instance.
12 int role=8;
13
14 void setup()
15 {
16 Serial.begin(9600); // Initiate a serial communication
17 SPI.begin(); // Initiate SPI bus
18 mfrc522.PCD_Init(); // Initiate MFRC522
19 pinMode(role,OUTPUT);
20 pinMode(LED_G, OUTPUT);
21 pinMode(LED_R, OUTPUT);
22 pinMode(BUZZER, OUTPUT);
23 noTone(BUZZER);
24 Serial.println("Put your card to the reader...");
25 Serial.println();
26
27 }
28 void loop()
29 {
30 // Look for new cards
31 if ( ! mfrc522.PICC_IsNewCardPresent())
32 {
33 return;
34 }
35 // Select one of the cards
36 if ( ! mfrc522.PICC_ReadCardSerial())
37 {
38 return;
39 }
40 //Show UID on serial monitor
41 Serial.print("UID tag :");
42 String content= "";
43 byte letter;
44 for (byte i = 0; i < mfrc522.uid.size; i++)
45 {
46 Serial.print(mfrc522.uid.uidByte[i] < 0x10 ? " 0" : " ");
47 Serial.print(mfrc522.uid.uidByte[i], HEX);
48 content.concat(String(mfrc522.uid.uidByte[i] < 0x10 ? " 0" : " "));
49 content.concat(String(mfrc522.uid.uidByte[i], HEX));
50 }
51 Serial.println();
52 Serial.print("Message : ");
53 content.toUpperCase();
54 if (content.substring(1) == "60 3D CB 57") //change here the UID of the card/cards
that you want to give access
55 {
56 Serial.println("Authorized access");
57 Serial.println();
58
59 delay(500);
60 digitalWrite(LED_G, HIGH);
61 digitalWrite(role,HIGH);
62 delay(5000);
63
64 digitalWrite(role,LOW);
65 digitalWrite(LED_G, LOW);
66 }
67
68 else {
69 Serial.println(" Access denied");
70 digitalWrite(LED_R, HIGH);
     
 
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.