Pages: [1]   Go Down
Author Topic: Arduino to arduino with bluetooth  (Read 601 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 16
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi.
I have two bluetooth modules. One master and one slave.
I've managed to get them paired but i don't know how i can test them.
Any one have a simple code that will read an analog pin on a arduino uno, and then sends the value over serial and write it to a servo?

I can't figure out what that code may look like.

Thanks  smiley
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 613
Posts: 49310
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
One master and one slave.
So, one will talk to an Arduino, and one wont.

I think that will cause you problems.
Logged

Austin, TX
Offline Offline
Faraday Member
**
Karma: 71
Posts: 6144
Baldengineer
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

What type of profile are the modules programmed to use?
Logged

Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

Offline Offline
Newbie
*
Karma: 0
Posts: 16
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What type of profile are the modules programmed to use?
Not sure if i know what you mean. Profile?

Quote
One master and one slave.
So, one will talk to an Arduino, and one wont.

I think that will cause you problems.
Do you have any suggestions on how to get this to work then? I want the uno to send values to an arduino mega. Do both of the bluetooth devices need to be master?
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 613
Posts: 49310
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Do both of the bluetooth devices need to be master?
For some reason, when I read your post, I was thinking that you said something about the bluetooth devices being USB devices. The Arduino is a USB slave, and only talks to USB Master/USB Host devices. Since you were not talking about USB devices, feel free to ignore me.
Logged

Austin, TX
Offline Offline
Faraday Member
**
Karma: 71
Posts: 6144
Baldengineer
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

What type of profile are the modules programmed to use?
Not sure if i know what you mean. Profile?
Bluetooth is a generic protocol with many "Profiles" that run in the application layer.  For example, serial devices have the "Serial Profile" while Audio devices may be a HID (headset) or use A2DP.

You have to know what the device is programmed to act like to know how to use it.

Not all bluetooth devices are interchangeable because of their application specific profiles.
Logged

Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

Offline Offline
Newbie
*
Karma: 0
Posts: 16
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What type of profile are the modules programmed to use?
Not sure if i know what you mean. Profile?
Bluetooth is a generic protocol with many "Profiles" that run in the application layer.  For example, serial devices have the "Serial Profile" while Audio devices may be a HID (headset) or use A2DP.

You have to know what the device is programmed to act like to know how to use it.

Not all bluetooth devices are interchangeable because of their application specific profiles.

Ahh, yes ofcourse. No i understand your question. Yes they are both for serial communication. I've managed to pair them to eachother but i need some example serial write/read code to uplode to both arduino's
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 16
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Anyone? smiley
Logged

0
Offline Offline
Edison Member
*
Karma: 24
Posts: 2309
Have you mooed today?
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,
here:
http://arduino.cc/forum/index.php/topic,104903.0.html
there's a collection of 3 base guides for using Bluetooth module (especially the low cost HC0*) with Arduino.
They are in italian, but schemes and codes are universal :-P
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 16
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,
here:
http://arduino.cc/forum/index.php/topic,104903.0.html
there's a collection of 3 base guides for using Bluetooth module (especially the low cost HC0*) with Arduino.
They are in italian, but schemes and codes are universal :-P

Hi, thanks for the link, but I only need some serial write/read example code. As I said earlyer iv'e managed to pair the bluetooth modules and the setup is correct.
Now I only need some code to upload to two arduinos so send serial commands between them  smiley
Logged

Austin, TX
Offline Offline
Faraday Member
**
Karma: 71
Posts: 6144
Baldengineer
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Now I only need some code to upload to two arduinos so send serial commands between them  smiley
There are plenty of examples of how to make two serial devices speak to each other.

You might start with whether the modules are wired to the hardware serial port of the ATmega328 or if you have to use Software Serial. 
Logged

Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

Pages: [1]   Go Up
Jump to: