Using Tx and Rx pins to communicate with bluetooth

Hello,
I have a project that is to connect arduino with a bluetooth module. the bluetooth accepts serial communication so i will use Tx and Rx pins and connect them with the module. I know the connection all i wanna know is the code in which to put in arduino software?? is it the same serial communication code that used to connect arduino with PC ??

What Arduino are you using?

An Uno has only one hardware serial port so if you want to connect to a PC (via USB) at the same time as using Bluetooth you will need to use the SoftwareSerial library to convert two other pins (other than pins 0 and 1) to extra Rx and Tx pins.

If you don't need to connect to a PC (after the Arduino program has been uploaded) then you can use Rx and Tx on pins 0 and 1. However it would be wise to disconnect the Bluetooth device whenever you need to upload a revised program.

...R

Robin2:
What Arduino are you using?

An Uno has only one hardware serial port so if you want to connect to a PC (via USB) at the same time as using Bluetooth you will need to use the SoftwareSerial library to convert two other pins (other than pins 0 and 1) to extra Rx and Tx pins.

If you don’t need to connect to a PC (after the Arduino program has been uploaded) then you can use Rx and Tx on pins 0 and 1. However it would be wise to disconnect the Bluetooth device whenever you need to upload a revised program.

…R

I was having a problem when i connect the Tx and Rx pins of the blueotooth with Tx and Rx pins of the arduino. it gave me an error ‘access is denied’

I think you just solved it for me by using SoftwareSerial, thanks a lot :slight_smile:

I need to ask one more thing, the arduino accepts abserial interface with AT command right ?

sorry im just new on arduino and still a newbie :frowning:

By the way im using arduino uno :smiley:

aalabed:
I was having a problem when i connect the Tx and Rx pins of the blueotooth with Tx and Rx pins of the arduino. it gave me an error ‘access is denied’

That error did not come from the Arduino - it has no access controls.

I need to ask one more thing, the arduino accepts abserial interface with AT command right ?

I don’t know what abserial is so I can’t answer your question. I believe the bluetooth devices can respond to AT commands but I have never heard of an Arduino doing so.

…R

What do you mean by it has no access controls ??

aalabed:
What do you mean by it has no access controls ??

PC operating systems (Linux, Mac and the other thing) all have levels of security that prevent unauthorized users doing some things. And Arduino board has no operating system and no access control.

…R