NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

//L298N Bağlantısı
const int motorA2 = 5; // L298N'in IN1 Girişi
const int motorB1 = 10; // L298N'in IN2 Girişi
const int motorA1 = 9; // L298N'in IN3 Girişi
const int motorB2 = 6; // L298N'in IN4 Girişi


int i=0; //Döngüler için atanan rastgele bir değişken
int j=0; //Döngüler için atanan rastgele bir değişken
int state; //Bluetooth cihazından gelecek sinyalin değişkeni
int vSpeed=255; // Standart Hız, 0-255 arası bir değer alabilir

void setup() {
// Pinlerimizi belirleyelim
pinMode(motorA1, OUTPUT);
pinMode(motorA2, OUTPUT);
pinMode(motorB1, OUTPUT);
pinMode(motorB2, OUTPUT);
// 9600 baud hızında bir seri port açalım
Serial.begin(9600);
}

void loop() {

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

/* Uygulamadan ayarlanabilen 4 hız seviyesi.(Değerler 0-255 arasında olmalı)*/
if (state == '0'){
vSpeed=255;}
else if (state == '1'){
vSpeed=210;}
else if (state == '2'){
vSpeed=180;}
else if (state == '3'){
vSpeed=150;}
else if (state == '4'){
vSpeed=120;}
else if (state == '5'){
vSpeed=80;}
else if (state == '6'){
vSpeed=60;}
else if (state == '7'){
vSpeed=40;}
else if (state == '8'){
vSpeed=20;}
else if (state == '9'){
vSpeed=10;}
else if (state == 'q'){
vSpeed=0;}
/***********************İleri****************************/
//Gelen veri 'F' ise araba ileri gider.
if (state == 'F') {
analogWrite(motorA1, vSpeed); analogWrite(motorA2, 0);
analogWrite(motorB1, vSpeed); analogWrite(motorB2, 0);
}
/**********************İleri Sol************************/
//Gelen veri 'G' ise araba ileri sol(çapraz) gider.
else if (state == 'G') {
analogWrite(motorA1,vSpeed ); analogWrite(motorA2, 0);
analogWrite(motorB1, 100); analogWrite(motorB2, 0);
}
/**********************İleri Sağ************************/
//Gelen veri 'I' ise araba ileri sağ(çapraz) gider.
else if (state == 'I') {
analogWrite(motorA1, 100); analogWrite(motorA2, 0);
analogWrite(motorB1, vSpeed); analogWrite(motorB2, 0);
}
/***********************Geri****************************/
//Gelen veri 'B' ise araba geri gider.
else if (state == 'B') {
analogWrite(motorA1, 0); analogWrite(motorA2, vSpeed);
analogWrite(motorB1, 0); analogWrite(motorB2, vSpeed);
}
/**********************Geri Sol************************/
//Gelen veri 'H' ise araba geri sol(çapraz) gider
else if (state == 'H') {
analogWrite(motorA1, 0); analogWrite(motorA2, 100);
analogWrite(motorB1, 0); analogWrite(motorB2, vSpeed);
}
/**********************Geri Sağ************************/
//Gelen veri 'J' ise araba geri sağ(çapraz) gider
else if (state == 'J') {
analogWrite(motorA1, 0); analogWrite(motorA2, vSpeed);
analogWrite(motorB1, 0); analogWrite(motorB2, 100);
}
/***************************Sol*****************************/
//Gelen veri 'L' ise araba sola gider.
else if (state == 'L') {
analogWrite(motorA1, vSpeed); analogWrite(motorA2, 0);
analogWrite(motorB1, 0); analogWrite(motorB2, 150);
}
/***************************Sağ*****************************/
//Gelen veri 'R' ise araba sağa gider
else if (state == 'R') {
analogWrite(motorA1, 0); analogWrite(motorA2, 150);
analogWrite(motorB1, vSpeed); analogWrite(motorB2, 0);
}

/************************Stop*****************************/
//Gelen veri 'S' ise arabayı durdur.
else if (state == 'S'){
analogWrite(motorA1, 0); analogWrite(motorA2, 0);
analogWrite(motorB1, 0); analogWrite(motorB2, 0);
}
}
     
 
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.