Notes
Notes - notes.io |
#include <LiquidCrystal.h>
#include <IRremote.h>
bool run = true;
int interrupt_pin_rising = 2;
int interrupt_pin_falling = 3;
char parola[]="123";
char kod[3];
char isStart = 'N';
int RECV_PIN = 12,i;
char keys[3][3] =
{
{'1','2','3'},
{'4','5','6'}, // Tuş takımı
{'7','8','9'}
};
byte rowPins[4] = {9, 8, 7};
byte colPins[3] = {6, 5, 4};
Keypad customKeypad = Keypad(makeKeymap(keys), rowPins, colPins, 3, 3); // Keypad nesnesi ve tuş takımı oluşturuldu
LiquidCrystal lcd(A1, 10, A2, A3, A4, A5);
IRrecv irrecv(RECV_PIN);
decode_results results;
void setup()
{
//attaching interrupt when ever motion detected
attachInterrupt(digitalPinToInterrupt(interrupt_pin_rising), motion_detected, RISING);
//attaching interrupt when ever motion is reset
attachInterrupt(digitalPinToInterrupt(interrupt_pin_falling), motion_reset, FALLING);
Serial.begin(9600);
pinMode(13,OUTPUT);
lcd.begin(16, 2);
irrecv.enableIRIn();
irrecv.blink13(true);
}
void loop()
{
char customKey = customKeypad.getKey(); // Keypad'den gelen değer okundu ve customKey değişkenine atandı
if (customKey != NO_KEY) // Eğer bir tuşa basıldıysa
{
}
if (irrecv.decode(&results)) {
Serial.println(results.value, DEC);
if (results.value == 16580863){
digitalWrite(13,HIGH);
}
irrecv.resume(); // Yazılmazsa her 100 saniyede aynı tuşu yakalar
}
delay(100);
if(run)
{
analogWrite(A0, 150);
}
else
{
analogWrite(A0, 0);
}
}
void motion_detected()
{
lcd.clear();
lcd.print("Hareket Tespit");
lcd.setCursor(0,1);
lcd.print("Edildi");
run = false;
}
void motion_reset()
{
lcd.clear();
lcd.print("Hareket Tespit");
lcd.setCursor(0,1);
lcd.print("Edilmedi");
run = true;
}
/* REMOTE
16580863 => Açma Kapama düğmesi
16582903 => 1
16615543 => 2
16599223 => 3
16591063 => 4
16623703 => 5
16607383 => 6
16586983 => 7
16619623 => 8
16603303 => 9
if (irrecv.decode(&results)) {
Serial.println(results.value, DEC);
if (results.value == 16580863){
digitalWrite(13,HIGH);
}
irrecv.resume(); // Receive thxt value
}
delay(100);
*/
/* PİEZZO
tone(11, 640);
delay(250);
} else{
alarm = 0;
noTone(11);
}
*/
/** KEYPAD
char customKey = customKeypad.getKey(); // Keypad'den gelen değer okundu ve customKey değişkenine atandı
if (customKey != NO_KEY) // Eğer bir tuşa basıldıysa
{
kod[cont]=customKey; // 4 uzunluktaki dizinin ilk değerine bu değer atandı
Serial.write(kod[cont]); // Girilen değer ikinci arduino'ya aktarıldı
cont=cont+1; // sayaç 1 artırıldı
if(cont==4) // Eğer 4 adet rakam girildiyse parola kontrolü yapıldı
{
if(kod[0]==parola[0]&&kod[1]==parola[1]&&kod[2]==parola[2]&&kod[3]==parola[3])
{ // Eğer ilk parola girildiyse sensörleri aktifleştir
level = '1';
}
else if(kod[0]==parola2[0]&&kod[1]==parola2[1]&&kod[2]==parola2[2]&&kod[3]==parola2[3])
{ // Eğer ilk parola girildiyse sensörleri pasifleştir
level = '2';
lcd2.clear();
}
cont=0; // Tekrar parola girişi için sayacı sıfırla
}
}
*/
|
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