Skip to content

Instantly share code, notes, and snippets.

@RobolinkAkademi
Created November 14, 2019 11:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save RobolinkAkademi/771be6e3f8e9cd9681d2fe2e55da05ce to your computer and use it in GitHub Desktop.
Save RobolinkAkademi/771be6e3f8e9cd9681d2fe2e55da05ce to your computer and use it in GitHub Desktop.
Arduino ile bluetooth kontrollü robot
#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