Show Posts
Pages: 1 ... 10 11 [12] 13 14 ... 111
166  Using Arduino / Networking, Protocols, and Devices / Re: Bluetooth connection (HC-06 v2.0) between Pro micro (ATmega32U4) and Android App on: March 07, 2014, 08:16:17 pm
The operating voltage of the bluetooth module is 3.3V, so there is no problem with the power supply!
........
It is a normal JY-MCU HC-06 Bluetooth Board

I believe these are conflicting statements and you should check it again. If you are feeding the JY-MCU from the 3.3v Pro Micro or its supply, then it is a fair bet that you are feeding it 3.3v. Irrespective of this Keyes stuff, a "normal  JY-MCU HC-06 Bluetooth Board" has the power supply requirement very clearly marked on the back, and it says 3.6 - 6v. This clearly implies that you are about 10% short of the minimum. This might not be an ironclad guarantee of disaster, but it is certainly a very good way of inviting it.


Quote
The code that I sent works perfectly on the other Bluetooth Board of the Seeed Studio Bluetooth Shield and it achieves pairing with the android tablet and when I run the app I can see the generated readings from the Pro Micro.

I submit that the best you can really say is that some of the code actually allows you to achieve your end but it is still junk and some, if not most, is redundant and speaks volumes about what is really going on.

Two cases in point:

1. The HC-06 is a slave and cannot be anything else, so why are you attempting to set it up as a slave?
Code:
  Serial1.print("\r\n+STWMOD=0\r\n"); //set the bluetooth work in slave mode
I'm not sure, but I believe the same question might be asked even if it was a master.

2. Since the HC-06 is a slave, no code in the Arduino can achieve pairing with an Android tablet. All the pairing is done by the Android and Arduino doesn't even need to be present for it to achieve that.

I guess that part of the problem is that the code is inherited from the Seed, which I believe does not use an HC-06, but suspect it would be junk on the Seed as well - at best, a mish-mash of demonstration stuff that is short on practical application. I suggest you ditch it all and start over.

If your HC-06 is what you imply it is, i.e. normal, the code I linked to will be sufficient to at least prove your equipment is kosher.  Indeed I might add that if you don't get a result with the notes provided, it is very likely that you have a power problem.

Quote
is there a basic code to program the Pro Micro  in order to generate and send readings through bluetooth to a custom android app

Once you have ditched all the junk and proven you gear kosher, Arduino essentially needs no more than

Code:
void loop()
{
gather data;
Serial.print (data);
}
 

which is more or less what everybody else does.

The custom Android app is, of course, down to you, and I guess that is what this is all about.
167  Using Arduino / Networking, Protocols, and Devices / Re: Bluetooth connection (HC-06 v2.0) between Pro micro (ATmega32U4) and Android App on: March 07, 2014, 10:44:20 am
OK, the first thing you need to do is read the first post in the section and see how to enter code using the hash icon.

You didn't answer about the power supply but I'm not sure that matters - for the moment - as the code appears to be junk from beginning to end.

Some of this may be justified by intent outside the code shown or, less likely, something to do with the shield, but I doubt both, as one HC-06 is very much like another and, even if there is a difference between the ones you have, I bet it is immaterial.   

One of the main problems is that you are incorporating Bluetooth programming in the arduino programme although the only things I can really recognise are the change of baud rate and the establishment of slave mode. Don't bother telling me why  or how you do this with an HC-06. If there is an answer it will be lost on me, but I think it is a very clear indication of what is going on.

I guess the immediate objective is to prove that Bluetooth will talk to Arduino. I have never heard of a HC-06 Keyes BT_BOARD v2.0 and Google apparently hasn't heard of it either but you do say it is an HC-06 and maybe it is made specifically for the Pro Micro, so , if you are sure it will work on 3.3v, the link below has all you should need to establish communication between Arduino and Android via Bluetooth..

So maybe it will help.

http://homepages.ihug.com.au/~npyner/Arduino/GUIDE_2BT.pdf
http://homepages.ihug.com.au/~npyner/Arduino/BT_2_WAY.ino





168  Using Arduino / Networking, Protocols, and Devices / Re: Bluetooth connection (HC-06 v2.0) between Pro micro (ATmega32U4) and Android App on: March 07, 2014, 08:28:44 am
Seeing the name and entering the password sounds very much like pairing, so maybe it did. A confirmation that it didn't is the LED still flashing. There could be a problem with the power supply. Are you sure the shield you are using is kosher for 3.3v operation?
169  Using Arduino / Project Guidance / Re: Arduino internet access via Bluetooth connection to iPhone on: March 07, 2014, 08:10:47 am
Since I guess you have an iPhone in your pocket, the first thing to do is check for an app that will do what you want i.e. accept bluetooth data from a third party and pass them to the internet. If that is the case, you might be able to do this with a BLE module. These module will allow connection between Arduino and IOS.
170  Using Arduino / Project Guidance / Re: Arduino + Bluetooth + Relay + LCD Touch Screen on: March 07, 2014, 08:02:12 am
The guts of the shield is an HC-06 bluetooth module and it is the same as that on a JY-MCU backboard, so the choice is largely personal or governed by other things. One of the "other things" is what else goes on the Arduino, in this case the touch screen, which can bring its own problems. Some screens are too big for a UNO and must go on Mega. This can bring serious problems if you want to use a Uno-sized bluetooth shield. The JY-MCU is on flying leads and can be more easily connected. 

If you are sure you want a little screen that can sit on a Uno-size shield, that will sit OK on the bluetooth shield shown.

I might point out that the big screens that are for Mega use all the pins that Uno don't have and thus leave the "normal" pins for other purposes. I don't know about touch screens on a Uno but I get the impression that they aren't a good idea.
171  Using Arduino / Project Guidance / Re: Creating a bluetooth controller on: March 07, 2014, 07:44:29 am
when I have my robot in autonomous it mode it can't pick up the command to switch because the buffer is constantly over written by the accelerometer data, when ever the program gets a delay,because I can't get it to stop sending the accelerometer data. 

Dr Frankenstein does spring to mind here.  This is all out of my field, being a humble data-logger myself, but I will be interested to hear how this all pans out........
172  Using Arduino / Project Guidance / Re: Creating a bluetooth controller on: March 07, 2014, 12:10:32 am
the HC-05 and HC06 do not automatically pair. 

I won't ask where I might have heard that before. Maybe Hazard is onto something, but more to the point is the Android. It seems that your real problem is getting a command to robot to do what I imagine is a simple task - switch off something - and I'm surprised if it's hard. I know nothing about it, but one of the biggest threads on the forum is about bluetooth Android joysticks. It goes on for pages, so surely there is something in there about task commands as well?

I'm not motivated to follow Cantin. I think, if you are going to spend the money, it might be better to use NRF24, but you might get value from him.
173  Using Arduino / Networking, Protocols, and Devices / Re: I Need To Use a Java Program To Receive Bytes From an MPU Using Bluetooth on: March 06, 2014, 11:21:16 pm
I'm not sure this matters but you have not explained why the HC-05 sets up two comports. You might have explained that the XP bluetooth wizard does that, but not how, or indeed why it should. There is no evidence that the the HC-05 does anything. Further, you don't get two comports under XP when talking to HC-05 with the Toshiba Bluetooth stack, nor do you get two ports when when using Android.  So, if you have a problem with two ports, HC-05 is probably innocent, and it's a windows problem. As I said there has been discussion before, but I didn't pursue it because I have never had the problem - if there is one.
174  Using Arduino / Project Guidance / Re: Creating a bluetooth controller on: March 06, 2014, 10:57:43 pm
Quote
I'm not surprised you have no idea how to do it and, while Hazard may be inclined to elaborate, I don't think the HC-0x are a good place to start.
It's a simple serial connection, why is that hard to understand?

I also found out that a master wont connect to the bluetooth in a computer or laptop nor will it connect to another master. You can have Master to slave and slave to slave but that's it.

The module AgentNoise has, must be a slave otherwise it would not have connect to his phone, unless his phone knows to change the state of the module from master to slave, but I doubt it.

What Agent said was
Quote
I have no idea how to have the Arduino controller be a master Bluetooth and have it connect to a slave Bluetooth without the help of an OS.

This is not a simple serial question and it is hard to understand.  One thing for sure, is that it is a hell of along way from
Quote
If you can send a single character to the arduino with the serial monitor, then it should not be so difficult to remove the connection and make it wireless.

It is not simple if only because a connection to the serial monitor takes no extra progarmming, but this exercise will. Indeed, rather lot, I imagine,  and probably none of which I know anything about.

What you said was
Quote
most HC-05/06 modules pair automatically when they are within a 30 ft range of each other.

I have never seen that,  I don't know anybody else who has either, and I would like to know how you do that. I'm not saying it doesn't happen, yet, but I believe others do. I'm saying that that is what I want to do and have not been able to find out how.  It could be that there is a great swirling sea of Arduino <> Arduino bluetooth communication somewhere, but it is somewhere else. Needless to say, I'm prepared to set up my HC-05 as a master on the strength of good evidence., but I admit it is a low-priority item.

The module Agent has is indeed a slave, an HC-06, but I don't think that matters. Phones are masters and have no trouble communicating with each other, or with laptops for that matter,  without any need to change their configuration. The HC-05 is a slave by default anyway.

So what have you got?
175  Using Arduino / Project Guidance / Re: Creating a bluetooth controller on: March 06, 2014, 07:39:41 pm
As I understand it, you simply want to use another Arduino as a controller i.e. Arduino <> Arduino communication,  rather than the phone. I'm not surprised you have no idea how to do it and, while Hazard may be inclined to elaborate, I don't think the HC-0x are a good place to start.

The only example of Arduino <> Arduino communication I have ever found is here.

http://phillipecantin.blogspot.com.au/2012/01/arduino-bluetooth-link.html

This has auto-connect and the full symphony but note particularly that he is not using HC-0x, not even as the slave. Maybe that was just his inclination and I can't see why an HC-06 cannot be used as the slave.  He uses BlueSmirf

I'm speculating that there are varying degrees of master, and while the HC-05 can be configured as a master, it is short of the commands to be sufficiently masterful in order to run an HC-06.  It can probably be used as master with gamepads etc., but I don't indulge in that and I have never seen a situation where the HC-05 is employed as master. When I asked here before about Arduino <> Arduino communication with HC-05, all I got was deafening silence, and I think that said it all.

Stick with the phone! They seem ideal for the purpose, and probably cheaper than Arduino+BlueSmirf
176  Using Arduino / Storage / Re: saving calculated values on: March 06, 2014, 07:06:54 pm
OK, you could have fixed the code bit by editing the previous post. You are now about to incur the wrath of your peers by having two posts on the same subject, thereby causing confusion, and you should  delete one of them.

It looks like sanity has prevailed in your actual code, which otherwise was only going to get worse. Now read the second bit I wrote, the line is more or less the same, and the same principle applies to LCD display.

The datalogging example included with the SD library demonstrates this, and is essentially all you need. It is just a matter of melding the two codes i.e the SD preamble, setup and loop stuff included in those for the speed. I believe the same datalogger is in the examples section of the IDE.
177  Using Arduino / Networking, Protocols, and Devices / Re: Use of old Android smartphone as bluetooth receiver possible? on: March 06, 2014, 06:47:29 pm
I appreciate what you say. I only got in to this because I wanted to salvage a (new) tablet that was giving me bluetooth grief. I never pursued it as I eventually got the tablet to run bluetooth.

I believe there are better things that you can do than a bluetooth tether anyway.  It can serve as an Arduino  display to die for. The 10" tablet is running Bluetooth Graphics Terminal, displaying three graphs and, so long as the charger is connected, it never goes to sleep.  The phone can probably do the same thing.
178  Using Arduino / Networking, Protocols, and Devices / Re: I Need To Use a Java Program To Receive Bytes From an MPU Using Bluetooth on: March 06, 2014, 06:32:40 pm
The way the HC-05 works is, two comports are created.  I think they refer to them as Virtual Comports.  I can't seem to get beyond the "Discovered" step to get to the comports.

Ready for more confusion? 

No, I'm confused enough already, but I don't think that is the way the HC-05 works. It is innocently sitting at the other end on the Arduino doing exactly what it is supposed to do, and the real problem is the bluetooth dongle, possibly caused by pilot error. There was similar discussion here a few weeks ago, you might be able to google it up.
179  Topics / Science and Measurement / Re: Temperature control/data logging with excel on: March 06, 2014, 06:01:44 pm
I believe you can do this by keyboard shortcut within Excel, therefore you may be able to do this from Ardujino by sending the appropriate string.
180  Using Arduino / Networking, Protocols, and Devices / Re: Connect two I2C devices to Mega 2560 on: March 06, 2014, 11:18:44 am
Essentially yes, but there is probably a sensible limit that you are not likely to reach.
Pages: 1 ... 10 11 [12] 13 14 ... 111