Go Down

Topic: Arduino to arduino with bluetooth (Read 738 times) previous topic - next topic

redkite

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  :)

PaulS

Quote
One master and one slave.

So, one will talk to an Arduino, and one wont.

I think that will cause you problems.

James C4S

What type of profile are the modules programmed to use?
Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

redkite


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?

PaulS

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.

James C4S



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.
Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

redkite




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


pitusso

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

redkite


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  :)

James C4S


Now I only need some code to upload to two arduinos so send serial commands between them  :)

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. 
Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

Go Up