SERVO CONTROL VIA BLUETOOTH

Servo bluetooth

/*

We can control servo via Bluetooth. When we upload the sket please release TX and RX cable from Arduino because when RX and TX are connected the Arduino’s USB communication will be disconnected. Operate the servo via another computer connected to bluetooth using the Arduino IDE or Tera Term.

*/

#include <Servo.h>

Servo servo1;

long num;

void setup()

{

servo1.attach(9);

Serial.begin(9600);

Serial.print(“Enter Position = “);

}

void loop()

{

while(Serial.available()>0)

{

num= Serial.parseInt();

Serial.print(num);

Serial.println(” degree”);

Serial.print(“Enter Position = “);

}

servo1.write(num);

delay(15);

}

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s