simple code to get Bluetooth to send and recieve.

I need some simple guidance setting up my bluetooth.
My computer does have connectivity to my Bluetooth.

Currently the Bluetooth is connected to the GND and the 5V so it is getting power. Now I need to know what I should plug my TX and RX into on the Arduino.

I do have this simple LED blink code for USB connectivity but how should it be altered for Bluetooth connectivity?

void setup() {
// initialize the digital pin as an output.
// Pin 13 has an LED connected on most Arduino boards:
pinMode(13, OUTPUT);
}

void loop() {
digitalWrite(13, HIGH); // set the LED on
delay(1000); // wait for a second
digitalWrite(13, LOW); // set the LED off
delay(1000); // wait for a second
}

It is not clear what your bluetooth device is or which Arduino board you have. Be as informative as you can (but keep it as short as possible :slight_smile:

A quick google on the Arduino site gave me - Arduino Playground - Tutorial01 - should help you to get started

give it a try and let us hear from your results!
Rob

I am using a "Arduino Dumeilanove w/Atmega328" and the bluetooth module is called a BlueSMiRF Gold from SparkFun.

I did try that tutorial you gave me the link to. Unfortunately I could see my Blue tooth module trying to connect, the green light was flashing but ultimately the connection was not able to be made.

It appears there is something going on with my connection to the bluetooth because I know both the arduino and processing code works via USB.

I am stumped on this one and would really appreciate a little help. I would be willing to pay some online tuition for help with this problem .

Have you paired your computer with the BT module (entering 0000) or whatever the code is?

Have you got the BT module and computer ends using the same baud rate?

Another point to check is if the BT and the USB both use the same Serial Port of the Arduino. If you are using processing via the USB port the hardware Serial is allready used.

So should I only be using the bluethooth via processing ?
Or can I also program the Arduino with Arduino code ?

It's a simple blinking LED script I am trying to send to the Arduino.
When I untether the Arduino and try to send Arduino code via Bluetooth I get this error:

Binary sketch size: 970 bytes (of a 30720 byte maximum)
avrdude: stk500_getsync(): not in sync: resp=0x00
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51

btw I have set the baud rate in my Bluetooth to be 9600