1

I have been able to establish a successful connection between an RN-42 Bluetooth module and Arduino Uno, but I could not do the same with an Arduino Due. The module connects to the phone but whatever data I send is not registered. What is different on the Due in the context of Bluetooth connectivity? Baud-rate perhaps?

  • do you use hardwareserial or softserial? are you sure that you hooked up the rx tx as well as pwr and gnd correctly? – user3704293 Jan 17 '16 at 17:53
  • Please show your code and explain which pins the Bluetooth is connected to on both boards? – Visual Micro Jan 18 '16 at 16:40
  • int ledPin = 13; int state = 0; int flag = 0; void setup() { pinMode(ledPin, OUTPUT); digitalWrite(ledPin, LOW); Serial1.begin(115200); // Default connection rate for my BT module } void loop() { if(Serial.available() > 0){ state = Serial.read(); flag=0; } if (state == '0') { digitalWrite(ledPin, LOW); if(flag == 0){ Serial.println("LED: off"); flag = 1; } } else if (state == '1') { digitalWrite(ledPin, HIGH); if(flag == 0){ Serial.println("LED: on"); flag = 1; } } } – Sujoy Purkayastha Jan 18 '16 at 17:01
  • The pins are: 5v(RN-42) --> 5v (Arduino due), GND(RN-42) --> GND(Arduino due), RX(RN-42) --> TX(Arduino due), TX(RN-42) --> RX(Arduino due), these are the project details @VisualMicro – Sujoy Purkayastha Jan 18 '16 at 17:08
  • Lastly, when I had 9600 as my baud rate in the code it didn't work. – Sujoy Purkayastha Jan 18 '16 at 17:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.