NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

#include <Wire.h> // Sensör kütüphanesi dahil edildi
//L298N Bağlantısı
const int motorA1 = 5; // L298N'in IN3 Girişi
const int motorA2 = 6; // L298N'in IN1 Girişi
const int motorB1 = 10; // L298N'in IN2 Girişi
const int motorB2 = 9; // L298N'in IN4 Girişi
const int Led = 13 ; // Led'in Girişi
const int sinyalpin = 12; // Sensör'ün Girişi
const int buzzerpin = 11; // Buzzer'ın Girişi

int val ; //Sensör cihazından gelecek sinyalin değişkeni
int state; //Bluetooth cihazından gelecek sinyalin değişkeni

void setup() {
// Pinlerimizi belirleyelim
pinMode(motorA1, OUTPUT);
pinMode(motorA2, OUTPUT);
pinMode(motorB1, OUTPUT);
pinMode(motorB2, OUTPUT);
pinMode(buzzerpin, OUTPUT);
pinMode (Led, OUTPUT) ;
pinMode (sinyalpin, INPUT) ;
digitalWrite(buzzerpin,HIGH);

// 9600 baud hızında bir seri port açalım
Serial.begin(9600);
}

void loop() {
/*Bluetooth bağlantısı koptuğunda veya kesildiğinde arabayı durdur.
(Aktif etmek için alt satırın "//" larını kaldırın.)*/
if(digitalRead(state)==LOW) { state='S'; }

//Gelen veriyi 'state' değişkenine kaydet
if(Serial.available() > 0){
state = Serial.read();
}

/***********************İleri****************************/
//Gelen veri 'F' ise araba ileri gider.
else if (state == 'F') {
digitalWrite(motorA1, HIGH); digitalWrite(motorA2, LOW);
digitalWrite(motorB1, HIGH); digitalWrite(motorB2, LOW);
}
/***********************Geri****************************/
//Gelen veri 'B' ise araba geri gider.
else if (state == 'B') {
digitalWrite(motorA1, LOW); digitalWrite(motorA2, HIGH);
digitalWrite(motorB1, LOW); digitalWrite(motorB2, HIGH);
}
/***************************Sol*****************************/
//Gelen veri 'L' ise araba sola gider.
else if (state == 'L') {
digitalWrite(motorA1, HIGH); digitalWrite(motorA2, 150);
digitalWrite(motorB1, LOW); digitalWrite(motorB2, LOW);
}
/***************************Sağ*****************************/
//Gelen veri 'R' ise araba sağa gider
else if (state == 'R') {
digitalWrite(motorA1, LOW); digitalWrite(motorA2, LOW);
digitalWrite(motorB1, HIGH); digitalWrite(motorB2, 150);
}

/************************Stop*****************************/
//Gelen veri 'S' ise arabayı durdur.
else if (state == 'S'){
digitalWrite(motorA1, LOW); digitalWrite(motorA2, LOW);
digitalWrite(motorB1, LOW); digitalWrite(motorB2, LOW);
}
/*********************BuzzerOn**************************/
//Gelen veri 'V' ise buzzerı çalıştırır.
else if (state == 'V') {
digitalWrite(buzzerpin,HIGH);
}
/*********************BuzzerOff*************************/
//Gelen veri 'v' ise buzzerı durdur.
else if (state == 'v')
{
digitalWrite(buzzerpin,LOW);
}
/********************* Finish *************************/

val = digitalRead (sinyalpin ) ; //Sensör cihazından gelecek sinyal değişkeninin ,sinyal pininden gelen sinyal ile eşit olması
if (val == HIGH) // Eğer Sinyal Gelmiyorsa ;
{
digitalWrite (Led, LOW); //Led Kapalı Durucak
digitalWrite(buzzerpin, 0 ); //Buzzer 0 şiddetinde çalışacak, yani buzzer kapalı

}
else // Eğer Sinyal Geliyorsa ;
{
digitalWrite(buzzerpin,200); // Buzzer 200 şiddetinde çalışacak
digitalWrite (Led, HIGH); // Led Açık Durucak

}
}
     
 
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.