Loading...
Pages: [1]   Go Down
Author Topic: Arduino/BlueSmirf Bluetooth Connection issues  (Read 479 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Full Member
***
Karma: 0
Posts: 122
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hey guys,
not sure if this is the right place for this question, but it involves an example code so maybe it is.
for a project of mine, of i have an older arduino mega 1280 connected to a blue smirf gold from sparkfun: http://www.sparkfun.com/products/158
however, with the example code provided with arduino 1.0, i can't get anything to show up in the bluetooth serial port(using putty for the bluetooth port)
does anybody have an idea as to why the bluetooth would be seemingly not working? I have the hardware connections exactly as they say in the sample code:
RX(bluesmirf)-->TX(pin 3)(arduino)
TX(bluesmirf)-->RX(pin 2)(arduino)
VCC(bluesmirf)-->3.3v arduino mega
ground-->ground

Code:
/*
  Software serial multple serial test
 
 Receives from the hardware serial, sends to software serial.
 Receives from software serial, sends to hardware serial.
 
 The circuit:
 * RX is digital pin 2 (connect to TX of other device)
 * TX is digital pin 3 (connect to RX of other device)
 
 created back in the mists of time
 modified 9 Apr 2012
 by Tom Igoe
 based on Mikal Hart's example
 
 This example code is in the public domain.
 
 */
#include <SoftwareSerial.h>

SoftwareSerial mySerial(2, 3); // RX, TX

void setup()  
{
 // Open serial communications and wait for port to open:
  Serial.begin(57600);
   while (!Serial) {
    ; // wait for serial port to connect. Needed for Leonardo only
  }

  
  Serial.println("Goodnight moon!");

  // set the data rate for the SoftwareSerial port
  mySerial.begin(4800);
  mySerial.println("Hello, world?");
}

void loop() // run over and over
{
  if (mySerial.available())
    Serial.write(mySerial.read());
  if (Serial.available())
    mySerial.write(Serial.read());
}
Logged

Delray Beach, FL USA
Offline Offline
Full Member
***
Karma: 0
Posts: 113
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Are you sure all 3 of the bluetooth module, the mega, and putty are set to talk the same baud rate?
Logged


0
Offline Offline
Full Member
***
Karma: 0
Posts: 122
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

yes, arduino and putty are set to proper bauds.
bluetooth is auto-negotiation so there is no setup needed physically on the bluetooth, im pretty sure about that.
Logged

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

Quote
i have an older arduino mega 1280
which has 4 hardware serial ports. So, why are you using SoftwareSerial?

SoftwareSerial only works on certain pins on the Mega. I don't recall which pins they are, but I do know that
1) it isn't needed.
2) pins 2 and 3 are not supported.
Logged

0
Offline Offline
Full Member
***
Karma: 0
Posts: 122
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well I don't really plan on the mega being used on this project much longer.  I was either gonna use a dum. Or a pro mini.  But I hadn't thought about the fact that certain pins might not work for software serial on the mega.  So when I get home I'll have to try other pins or the other available uarts.  But I'm still not convinced that's the problem.  Because when I connect the bluesmirf to the pins 0,1 which are for the default "serial" connection I still get nothing.  So I still think its a bluesmirf hardware issue.  Unless I'm wrong on that too.
Logged

Pages: [1]   Go Up
Print
 
Jump to: