Notes
Notes - notes.io |
//Muhammed Fikir; Kullanıcı girişinde sadece lm35 ve metal sayısı ekrana yazdırılacak.
//YENİ ANA KOD
#include <SPI.h>
#include <MFRC522.h>
int SdaPin=53;
int RstPin=5;
MFRC522 rfid(SdaPin, RstPin); //RFID nesnesi oluşturup bağlantı pinlerini tanımladık.
int yonetici_girisi=0;
//BUZZER KISMI
int Buzzer=7; //Pin tanımlaması yapıldı.
//LCD KISMI
#include <LiquidCrystal.h>
LiquidCrystal lcd(14, 15, 16, 17, 18, 19);
//KEYPAD KISMI
#include <Keypad.h>
const byte ROWS = 4; //4X4 OLDUĞUNU BELİRLİYORUZ
const byte COLS = 4;
char hexaKeys[ROWS][COLS] = { //KEYPADİN ÜZERİNDEKİ SAYI VE HARFLERİN KONUMLARINI TANIMLIYORUZ
{'1','2','3','A'},
{'4','5','6','B'},
{'7','8','9','C'},
{'*','0','#','D'}
};
char girilen_sifre[4];
int i;
byte rowPins[ROWS] = {44, 42, 40, 38}; //BAĞLANTI KISMI
byte colPins[COLS] = {45, 43, 41, 39};
Keypad customKeypad = Keypad( makeKeymap(hexaKeys), rowPins, colPins, ROWS, COLS); //VERİLERİ customKeypad'in içersine aktarıyoruz.
int artirim;
char sifre[4] = {'1','2','3','4'};
int zaman = 200;
void setup() {
SPI.begin(); //SPI haberleşmesini başlattık.
rfid.PCD_Init(); //RFID Kart okuyucuyu başlattık.
//TANIMLAMALAR
pinMode(Buzzer,OUTPUT);
lcd.begin(16, 2); //LCD'nin 2x16 olduğunu tanımlıyoruz
//İLK AÇILIŞ KISMI
lcd.setCursor(0,0); //İlk satıra yazdırmak için kullandığımız komut.
lcd.print("METAL AYRISTIRMA");
lcd.setCursor(0,1); //İmleci alt satıra taşıyoruz
lcd.print(" PROJESI ");
delay(2000);
lcd.clear(); //lcd ekrandaki eski yazıları siliyoruz.
delay(100);
lcd.print("SIFREYI GIRINIZ:");
delay(2000);
lcd.clear();
}
void loop() {
char customKey = customKeypad.getKey(); //Keypadden veri okuma kısmını gerçekleştiriyoruz.
if(customKey){
girilen_sifre[i++]=customKey;
lcd.setCursor(i,1);
lcd.print("*");
digitalWrite(Buzzer,HIGH);
delay(5);
digitalWrite(Buzzer,LOW);
}
if(i==4){
delay(200);
if(strncmp(sifre,girilen_sifre,4)==0 || yonetici_girisi==1){
lcd.clear();
lcd.print("SIFRE DOGRU");
digitalWrite(Buzzer,HIGH);
delay(350);
digitalWrite(Buzzer,LOW);
i=0;
}
else{
lcd.clear();
lcd.print("YANLIS");
digitalWrite(Buzzer,HIGH);
delay(zaman);
digitalWrite(Buzzer,LOW);
delay(zaman);
digitalWrite(Buzzer,HIGH);
delay(zaman);
digitalWrite(Buzzer,LOW);
i=0;
}
}
if (rfid.PICC_IsNewCardPresent()) {
if (rfid.PICC_ReadCardSerial()) {
Serial.print("Kart Tespit Edildi-Kart ID: ");
yonetici_girisi=1;
Serial.print(rfid.uid.uidByte[0]);
Serial.print(rfid.uid.uidByte[1]);
Serial.print(rfid.uid.uidByte[2]);
Serial.println(rfid.uid.uidByte[3]);
}
rfid.PICC_HaltA();
}
}
|
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