Bluetooth Mate Gold

Hello, Android forum. I am a beginner to arduino how is having some problems with my Lilypad. I am wanting to use an accelerometer with a bluetooth mate gold modem. I have paired my Laptop with the device but when I try to upload the sketch for the accelerometer I get an error message saying the serial port is being used by another programme, it suggests I should close all programmes which amy be using it. I have closed all programmes but I still keep getting the same error message. Please help me out.

Thanks

Gregor

Gregor_Doverty: Hello, Android forum.

Hello what?

I get an error message saying the serial port is being used by another programme

I assume from the faux pas above that you have in fact connected a mobile phone to the computer. That being the case, the mobile phone software is very likely ceasing control of the bluetooth serial port. You will have to either remove the software or configure it to leave the bluetooth port alone.

Android Forum???!!! Rather embarrassing! I apologise, I have android on the brain as I am using an Android app for the project.

Thanks for the reply. I have definitely paired with the bluetooth modem. It is called Firefly 6019.

I have uploaded a sketch for the accelerometer to the Lilypad via FTDI cable and it is giving me readings. Here is this sketch,

void setup() {

Serial.begin(9600);  //this sets our baud rate to 9600

}

void loop() {

int sensorValueX = analogRead(A0);  //reads data from the X pin on the accelerometer, connected to Analog Pin 0 on the Lilypad Arduino

int sensorValueY = analogRead(A1);  //reads data from the Y pin on the accelerometer, connected to Analog Pin 1 on the Lilypad Arduino

int sensorValueZ = analogRead(A2);  //reads data from the Z pin on the accelerometer, connected to Analog Pin 2 on the Lilypad Arduino

// Serial.print(“sensorX: “);

Serial.println (sensorValueX, DEC);  //this prints the X values in the Serial Monitor

delay (500);  //Delay for smoothing the data printing in the Serial Monitor

// Serial.print(“sensorY: “);

Serial.println (sensorValueY, DEC);  //this prints the Y values in the Serial Monitor

delay (500);

// Serial.print(“sensorZ: “);

Serial.println (sensorValueZ, DEC);  //this prints the Z values in the Serial Monitor

delay (500);

}

For the bluetooth mate I have uploaded the following sketch and established a connection with my mac. This seems to work fine,
//Arduino code

void setup() {
 Serial.begin(115200); //The Bluetooth Mate has a baud rate of 115200, faster than the 9600 we're used to.
}

void loop() {
//
}

When I go on to combine the two as follows,

//Arduino code

void setup() {
 Serial.begin(115200); //The Bluetooth Mate has a baud rate of 115200, faster than the 9600 we're used to.
}

void loop() {

int sensorValueX = analogRead(A0);  //reads data from the X pin on the accelerometer, connected to Analog Pin 0 on the Lilypad Arduino

int sensorValueY = analogRead(A1);  //reads data from the Y pin on the accelerometer, connected to Analog Pin 1 on the Lilypad Arduino

int sensorValueZ = analogRead(A2);  //reads data from the Z pin on the accelerometer, connected to Analog Pin 2 on the Lilypad Arduino

// Serial.print(“sensorX: “);

Serial.println (sensorValueX, DEC);  //this prints the X values in the Serial Monitor

delay (500);  //Delay for smoothing the data printing in the Serial Monitor

// Serial.print(“sensorY: “);

Serial.println (sensorValueY, DEC);  //this prints the Y values in the Serial Monitor

delay (500);

// Serial.print(“sensorZ: “);

Serial.println (sensorValueZ, DEC);  //this prints the Z values in the Serial Monitor

delay (500);

}

The sketch uploads but when I reconnect the Bluetooth mate there is nothing happening.
If I establish the connection with the modem then try to upload the accelerometer code wirelessly I get the message saying the port is being used by something else. I have made sure I am using the correct port.

Do you have any suggestions?

Thank you

Moderator edit:
</mark> <mark>[code]</mark> <mark>

</mark> <mark>[/code]</mark> <mark>
tags added.

Do you have any suggestions?

I don't. It's beyond my experience. I'll move your topic where it might get more attention...