NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io


int t;
int i=0;
int j=0;
int vSpeed=255;

const int motor1 = 5;
const int motor2 = 6;
const int motor3 = 9;
const int motor4 = 10;
const int led = 13;


void setup() {

// Pinlerimizi belirleyelim
pinMode(motor1, OUTPUT);
pinMode(motor2, OUTPUT);
pinMode(motor3, OUTPUT);
pinMode(motor4, OUTPUT);
pinMode(led, OUTPUT);

Serial.begin(9600);
Serial.setTimeout(30000); // 30.000 ms (30 saniye) bekleme
}

void loop() {
test_mode();
// if(digitalRead(t)==LOW) { t='S'; }

if(Serial.available()){
t = Serial.read();
Serial.println(t);

if (t == '0'){
vSpeed=0;}
else if (t == '1'){
vSpeed=100;}
else if (t == '2'){
vSpeed=180;}
else if (t == '3'){
vSpeed=200;}
else if (t == '4'){
vSpeed=255;}

}

if(t == 'F') {
analogWrite(motor1, 0);
analogWrite(motor2, 0);
analogWrite(motor3, vSpeed);
analogWrite(motor4, vSpeed);
Serial.println("İleri Komutu Verildi");
}

else if (t == 'B') {
analogWrite(motor1, vSpeed);
analogWrite(motor2, vSpeed);
analogWrite(motor3, 0);
analogWrite(motor4, 0);
Serial.println("Geri Komutu Verildi");
}

else if (t == 'G') {
analogWrite(motor1, vSpeed);
analogWrite(motor2, vSpeed);
analogWrite(motor3, 0);
analogWrite(motor4, 0);
Serial.println("Geri Komutu Verildi");
}
else if(t == 'R') {
analogWrite(motor1, 0);
analogWrite(motor2, 0);
analogWrite(motor3, vSpeed);
analogWrite(motor4, 0);
Serial.println("Sağa Dön Komutu Verildi");
}

else if(t == 'L') {
analogWrite(motor1, 0);
analogWrite(motor2, 0);
analogWrite(motor3, 0);
analogWrite(motor4, vSpeed);
Serial.println("Sola Dön Komutu Verildi");
}

else if(t == 'S') {
analogWrite(motor1, 0);
analogWrite(motor2, 0);
analogWrite(motor3, 0);
analogWrite(motor4, 0);
Serial.println("Dur Komutu Verildi");
}

else if(t == 'X') {
digitalWrite(led, HIGH);
Serial.println("Aydınlatma Açıldı");
}

else if(t == 'Y') {
digitalWrite(led,LOW);
Serial.println("Aydınlatma Kapatıldı");
}
}
void test_mode () {

if (t == '5') {
Serial.println("Test Modu Etkinleştirildi.");
delay(1000);
Serial.println("İleri Gitme Test Ediliyor.");
delay(500);
analogWrite(motor3,255);
analogWrite(motor4,255);
delay(2000);
analogWrite(motor3,0);
analogWrite(motor4,0);
delay(1000);

Serial.println("Geri Gitme Test Ediliyor.");
delay(500);
analogWrite(motor1,255);
analogWrite(motor2,255);
delay(2000);
analogWrite(motor1,0);
analogWrite(motor2,0);
delay(1000);

Serial.println("Sağa Dönme Test Ediliyor.");
delay(500);
analogWrite(motor3,255);
delay(2000);
analogWrite(motor3,0);
delay(1000);

Serial.println("Sola Dönme Test Ediliyor.");
delay(500);
analogWrite(motor4,255);
delay(2000);
analogWrite(motor4,0);
delay(1000);

Serial.println("Aydınlatma Test Ediliyor.");
delay(500);
digitalWrite(led,HIGH);
delay(2000);
digitalWrite(led,LOW);
delay(1000);

Serial.println("Vites 1 Test Ediliyor.");
delay(500);
analogWrite(motor3,100);
analogWrite(motor4,100);
delay(2000);
analogWrite(motor3,0);
analogWrite(motor4,0);
delay(1000);

Serial.println("Vites 2 Test Ediliyor.");
delay(500);
analogWrite(motor3,180);
analogWrite(motor4,180);
delay(2000);
analogWrite(motor3,0);
analogWrite(motor4,0);
delay(1000);

Serial.println("Vites 3 Test Ediliyor.");
delay(500);
analogWrite(motor3,200);
analogWrite(motor4,200);
delay(2000);
analogWrite(motor3,0);
analogWrite(motor4,0);
delay(1000);

Serial.println("Vites 4 Test Ediliyor.");
delay(500);
analogWrite(motor3,255);
analogWrite(motor4,255);
delay(2000);
analogWrite(motor3,0);
analogWrite(motor4,0);
delay(1000);

Serial.println("Test Başarıyla Tamamlandı.");
delay(500);
Serial.println("☪ 2018 TÜBİTAK AYYILDIZ ARABA PROJESİ ☪");
delay(500);
}

else if (t == 'I') {

Serial.println("İleriye Gitmek için (F) tuşuna basınız.");
delay(500);
Serial.println("Geriye Gitmek için (B veya G) tuşuna basınız.");
delay(500);
Serial.println("Sağ Tarafa Dönmek için (R) tuşuna basınız.");
delay(500);
Serial.println("Sol Tarafa Dönmek için (L) tuşuna basınız.");
delay(500);
Serial.println("Durmak için (S) tuşuna basınız.");
delay(500);
Serial.println("Ayndınlatmayı Açmak için (X) tuşuna basınız.");
delay(500);
Serial.println("Ayndınlatmayı Kapatmak için (Y) tuşuna basınız.");
delay(500);
Serial.println("Ayrıca (1,2,3,4) tuşuna basarak vites sistemimizi kullanabilirsiniz.");
delay(500);
Serial.println("Test Modunu Açmak için (5) tuşuna basınız.");
delay(500);
Serial.println("☪ 2018 TÜBİTAK AYYILDIZ ARABA PROJESİ ☪");
delay(500);
//for (;;);
}
}




     
 
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.