Created
November 14, 2019 11:15
-
-
Save RobolinkAkademi/771be6e3f8e9cd9681d2fe2e55da05ce to your computer and use it in GitHub Desktop.
Arduino ile bluetooth kontrollü robot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<dmoto.h> | |
dmoto RodeoBt; | |
char alinan; | |
void setup() { | |
Serial.begin(9600); | |
RodeoBt.pinSet(); | |
} | |
void loop() { | |
// alinan = '0'; | |
if (Serial.available() > 0) { // Checks whether data is comming from the serial port | |
alinan = Serial.read(); // Reads the0 data from the serial port | |
} | |
delay(10); | |
if (alinan == 'F' ) | |
{ | |
RodeoBt.Forward(150); | |
} | |
if (alinan == 'B' ) | |
{ | |
RodeoBt.Backward(150); | |
} | |
if (alinan == 'R' ) | |
{ | |
RodeoBt.Right(120, 60); | |
} | |
if (alinan == 'L' ) | |
{ | |
RodeoBt.Left(60, 120); | |
} | |
if (alinan == 'G' ) | |
{ | |
RodeoBt.Left(60, 190); | |
} | |
if (alinan == 'I' ) | |
{ | |
RodeoBt.Right(190, 60); | |
} | |
if (alinan == 'H' ) | |
{ | |
RodeoBt.BackLeft(60, 150); | |
} | |
if (alinan == 'J' ) | |
{ | |
RodeoBt.BackRight(150, 60); | |
} | |
if (alinan == 'S' ) | |
{ | |
RodeoBt.Stop(); | |
} | |
if (alinan == 'V' ) | |
{ | |
digitalWrite(buzzerPin, HIGH); | |
} | |
if (alinan == 'v' ) | |
{ | |
digitalWrite(buzzerPin, LOW); | |
} | |
if (alinan == 'W' ) | |
{ | |
digitalWrite(ledPin, HIGH); | |
} | |
if (alinan == 'w' ) | |
{ | |
digitalWrite(ledPin, LOW); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment