As pointed by @evolutionizer , you can't do SoftSerial + Serial (native) from pin 0 and pin 1. So the setup should be like this:
#include <SoftwareSerial.h>
#include <Servo.h>
Servo myservo1, myservo2, myservo3;
int bluetoothTx = 2;
int bluetoothRx = 3;
SoftwareSerial bluetooth(bluetoothTx, bluetoothRx);
void setup()
{
myservo1.attach(9);
myservo2.attach(10);
myservo3.attach(11);
//Setup USB serial connection to computer
Serial.begin(9600);
//Setup Bluetooth serial connection to android
bluetooth.begin(9600);
}
As for the movement for the servo, more information about data sent from Android is needed.
If the app is sending continuous value instead of sending only if the value is changed, you can do this trick:
unsigned int lastpost;
void loop()
{
//Read from bluetooth and write to usb serial
if (bluetooth.available() >= 2 )
{
unsigned int servopos = bluetooth.read();
unsigned int servopos1 = bluetooth.read();
unsigned int realservo = (servopos1 * 256) + servopos;
Serial.println(realservo);
if (realservo >= 1000 && realservo < 1360 && realservo!=lastpost) {
int servo1 = realservo;
servo1 = map(servo1, 1000, 1360, 0, 360);
myservo1.write(servo1);
Serial.println("servo 1 ON");
delay(10); //delay to wait servo rotate to desired position
lastpost = realservo;
}
...
}
...
}