error: expected constructor, destructor, or type conversion before '.' token

hi ,, i have this essue with my program
" error: expected constructor, destructor, or type conversion before '.' token"
recieving this error each time ! anyone help :cry: i really need help i don't have much time to finish the program.. please correct this for me .. thanx

my_program_quadcopter.ino (4.03 KB)

String readString;
#include <Wire.h>
#include <SoftwareSerial.h>
// Define o endereco do HMC5883 - 0x1E ou 30 em decimal
#define address 0x1E
#include <Servo.h>
int aang;
SoftwareSerial bluetooth(10, 11); // RX, TX
String inString = "";

Servo base; // create servo object to control a servo
Servo angle; // create servo object to control a servo

int valn; // variable to read the value from the analog pin

int lstx=400;
int lsty=124;
int lstz=293;

int xcontrol;
int ycontrol;

int xout,yout,zout;
volatile int state = LOW;

void setup()
{
// put your setup code here, to run once:
Serial.begin(9600);
attachInterrupt(0, LOCK, HIGH); // lock target here if attach calld by lock function
base.attach(5);
angle.attach(6);
Serial.begin(9600);
Wire.begin();

// Inicializa o HMC5883
Wire.beginTransmission(address);
// Seleciona o modo
Wire.write(0x02);
// Modo de medicao continuo
Wire.write(0x00);
Wire.endTransmission();
pinMode(13,OUTPUT);
}

void loop() {
if (readString == "BB") {
aang = aang + 5;
aang = constrain(aang, 0, 170);

angle.write(aang);

}
if (readString == "FF") {
aang = aang - 5;
aang = constrain(aang, 0, 170);

angle.write(aang);
}

if (readString == "SS") {
base.write(95);
}
if (readString == "RR") {
base.write(110);
}
if (readString == "LL") {
base.write(75);
}
if (readString == "II") {
base.write(110);
aang = aang - 5;
aang = constrain(aang, 0, 170);
angle.write(aang);
}
if (readString == "GG") {
base.write(75);
aang = aang - 5;
aang = constrain(aang, 0, 170);
angle.write(aang);
}
if (readString == "HH") {
base.write(75);
aang = aang + 5;
aang = constrain(aang, 0, 170);
angle.write(aang);
}
if (readString == "JJ") {
base.write(110);
aang = aang + 5;
aang = constrain(aang, 0, 170);
angle.write(aang);
}
}
void control() {
// put your main code here, to run repeatedly:
while (Serial.available()) {
delay(3);
char c = Serial.read();
readString += c;
}
if (readString.length() > 0) {
Serial.println(readString );
}
control();
readString = "";
delay(50);

}

//bt end
#include <wire.h>;

int x,y,z; //triple axis data

Wire.beginTransmission(address);
Wire.write(0x03); //select register 3, X MSB register
Wire.endTransmission();

// Le os dados de cada eixo, 2 registradores por eixo
Wire.requestFrom(address, 6);
if(6<=Wire.available())
{
x = Wire.read()<<8; //X msb
x |= Wire.read(); //X lsb
z = Wire.read()<<8; //Z msb
z |= Wire.read(); //Z lsb
y = Wire.read()<<8; //Y msb
y |= Wire.read(); //Y lsb
}

// Imprime os vaores no serial monitor
// Serial.print("x: ");
// Serial.print(x);
// Serial.print(" y: ");
// Serial.print(y);
// Serial.print(" z: ");
// Serial.println(z);
//// Serial.print(" lstx: ");
//// Serial.print(lstx);
// Serial.println("");

xout=x;
yout=y;
zout=z;

if(x-lstx < 20 && x-lstx > -20)
{
//digitalWrite(13,HIGH);
}
else
{
//digitalWrite(13,LOW);
}
//////////////////////////////////////////
if(y-lsty < 20 && y-lsty > -20)
{
// digitalWrite(13,HIGH);
}
else
{
// digitalWrite(13,LOW);
}
////////////////////////////////////////////
if(z-lstz < 20 && z-lstz > -20)
{
digitalWrite(13,HIGH);
}
else
{
digitalWrite(13,LOW);
}
///////////////////////////////////////
valn=x;
valn = map(valn, -500, 600, 0, 180); // scale it to use it with the servo (value between 0 and 180)
valn=valn + xcontrol;
xservo.write(valn); // sets the servo position according to the scaled value
// delay(100);

valn=z;
valn = map(valn, -500, 600, 0, 180); // scale it to use it with the servo (value between 0 and 180)
valn=valn + ycontrol;
yservo.write(valn); // sets the servo position according to the scaled value
delay(100);
// delay(750);
}

void LOCK()
{

lstx=xout;
lsty=yout;
lstz=zout;
}

Please read Read this before posting a programming question ... - Programming Questions - Arduino Forum

specifically #6, and please use ^T to format the code to be readable.

The message is indicating that you problem called a function before it was ready. I'm guessing (since I've had a similar problem) that you did not call the constructor or that you called it before everything was ready.

Is this maybe a problem?
SoftwareSerial bluetooth(10, 11); // RX, TX

i noticed that you are not using it anywhere.

ALL code belongs in a function. Starting with

  int x,y,z; //triple axis data
 
  Wire.beginTransmission(address);
  Wire.write(0x03); //select register 3, X MSB register
  Wire.endTransmission();

your code is NOT in a function.