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.