Offline
Newbie
Karma: 0
Posts: 16
|
 |
« on: December 09, 2012, 07:18:29 am » |
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 
|
|
|
|
|
Logged
|
|
|
|
|
Seattle, WA USA
Online
Brattain Member
Karma: 336
Posts: 36486
Seattle, WA USA
|
 |
« Reply #1 on: December 09, 2012, 07:30:40 am » |
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
Faraday Member
Karma: 42
Posts: 5248
CMiYC
|
 |
« Reply #2 on: December 09, 2012, 10:43:52 am » |
What type of profile are the modules programmed to use?
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 16
|
 |
« Reply #3 on: December 09, 2012, 04:44:40 pm » |
What type of profile are the modules programmed to use?
Not sure if i know what you mean. Profile? 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
Online
Brattain Member
Karma: 336
Posts: 36486
Seattle, WA USA
|
 |
« Reply #4 on: December 09, 2012, 04:50:54 pm » |
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
Faraday Member
Karma: 42
Posts: 5248
CMiYC
|
 |
« Reply #5 on: December 09, 2012, 05:40:51 pm » |
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
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 16
|
 |
« Reply #6 on: December 10, 2012, 05:10:14 am » |
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
Newbie
Karma: 0
Posts: 16
|
 |
« Reply #7 on: December 11, 2012, 05:32:43 am » |
Anyone? 
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Edison Member
Karma: 15
Posts: 1928
Have you mooed today?
|
 |
« Reply #8 on: December 11, 2012, 06:05:32 am » |
Hi, here: http://arduino.cc/forum/index.php/topic,104903.0.htmlthere'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
Newbie
Karma: 0
Posts: 16
|
 |
« Reply #9 on: December 18, 2012, 01:32:23 am » |
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 
|
|
|
|
|
Logged
|
|
|
|
|
Austin, TX
Offline
Faraday Member
Karma: 42
Posts: 5248
CMiYC
|
 |
« Reply #10 on: December 18, 2012, 11:21:35 am » |
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.
|
|
|
|
|
Logged
|
|
|
|
|
|