Arduino: Advanced Methods and Strategies of Using Arduino by Thorpe Ethan
Author:Thorpe, Ethan [Thorpe, Ethan]
Language: eng
Format: epub
Published: 2020-02-11T16:00:00+00:00
Setup () and Lopp () Functions
In the void setup () function we do all necessary initializations:
LCD;
Serial port;
mfrc522;
Input and output pins;
In addition, we have already called the StandardMessage () function to display a standard message on the LCD.
In the Void Loop () function, we have two if's that are present in all examples of programs in the MFRC522 .h library . (https://www.arduinolibraries.info/libraries/mfrc522)
In these two if's, specific library functions are called to search for a card in the vicinity of the reader, and select/read that card if present.
After this first step, we call the getUID () function, in which we separate the identification bytes of the card reader into a string named UID. In addition, we present this UID on the serial port.
If you still do not know the UID of your card, the first time you run the program, whenever you bring the card close to the reader, the access denied message will appear, because the UID that is in the program (22 C9 0A 10) is from the card we used to prepare the post.
Just open the serial terminal and bring the card closer to the reader, so the UID of your card will be displayed on the serial terminal, and you can replace the flag CardReleased in the program with your UID.
After loading the program with the updated flag, the message displayed for your card will be “Access Cleared.”
With the UID of the card read, we do an if-else to find out if this UID is the same as the one saved in the program (in the flag CardReleased).
If it is the same, the program displays the message “Access cleared” and triggers two beeps with the buzzer. If it is any other card, the message “Access Denied” is shown, and we trigger four beeps with the Buzzer.
Auxiliary Functions
We have three auxiliary functions, they are;
BuzzerBeeps (int NumberBeeps);
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Deep Learning with Python by François Chollet(12397)
Hello! Python by Anthony Briggs(9750)
OCA Java SE 8 Programmer I Certification Guide by Mala Gupta(9636)
The Mikado Method by Ola Ellnestam Daniel Brolund(9631)
Dependency Injection in .NET by Mark Seemann(9161)
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(8146)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(7652)
Grails in Action by Glen Smith Peter Ledbrook(7563)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(7389)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(6279)
Becoming a Dynamics 365 Finance and Supply Chain Solution Architect by Brent Dawson(6228)
Microservices with Go by Alexander Shuiskov(5991)
Practical Design Patterns for Java Developers by Miroslav Wengner(5904)
Test Automation Engineering Handbook by Manikandan Sambamurthy(5873)
Angular Projects - Third Edition by Aristeidis Bampakos(5216)
Kotlin in Action by Dmitry Jemerov(4918)
The Art of Crafting User Stories by The Art of Crafting User Stories(4789)
NetSuite for Consultants - Second Edition by Peter Ries(4756)
Demystifying Cryptography with OpenSSL 3.0 by Alexei Khlebnikov(4567)
