Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
10 years, 1 month ago.
RN-42 Bluetooth module with mbed lpc1768, I can not display the reading from the meter on LCD
/media/uploads/samialshorman/tera_term_error.docx dear all I used rn-42 Bluetooth module connected to lpc1768 through pin9 and pin 10. I consider this as a master by making the proper setting via Tera Term and I set authentication to be 0. my slave address is 001C0500D414. after inquery scan I get my slave device and save it in RN-42 module. then status give me connected. now I want to receive the reading from the slave and display it in LCD(I used mbed application board). but I did not get anything please advise for correct code. the code I used below.
- include "mbed.h"
- include "C12832.h"
C12832 lcd(p5, p7, p6, p8, p11);
Serial RNBT(p9,p10);
void initialise_connection() {
RNBT.putc('$'); Enter command mode
RNBT.putc('$');
RNBT.putc('$');
wait(0.5);
RNBT.putc('C');
RNBT.putc(','); Send remote address
RNBT.putc('0');
RNBT.putc('0');
RNBT.putc('1');
RNBT.putc('C');
RNBT.putc('0');
RNBT.putc('5');
RNBT.putc('0');
RNBT.putc('0');
RNBT.putc('D');
RNBT.putc('4');
RNBT.putc('1');
RNBT.putc('4');
wait(0.5);
RNBT.putc('-'); Exit command mode
RNBT.putc('-');
RNBT.putc('-');
RNBT.putc(0x0D);
wait(0.5);
}
char x;
void initialise_connection(void);
int main() {
RNBT.baud(115200);
initialise_connection();
while (1) {
if (RNBT.readable()) {
lcd.printf("%d\n",RNBT.getc());
}
}
}
Hi Sammy, i advice you that dont make multiple questions on the same topic in the forum. First please upload your photo of the connection you are making. Second, you can use printf function instead of putc to avoid putting one character at a time in the serial. Your code would have less lines. What is your slave device?
Greetings
posted by Ney Palma 27 Sep 2014dear Ney, my connections are correct, GND and power 3.3V then TX to RX and RX to TX. my slave device is nonin pulse oxemeter with remote address 001C0500D414
posted by Sami Alshorman 27 Sep 2014Hi Sami, have you read the pairing process available in the nonin manual?. I think maybe you can try to minimize baud rate value. Ex. 9600 to see what happen
I will try to help you the best i can, because i dont have the nonin device to do some tests. By the way which model is the nonin device?
posted by Ney Palma 29 Sep 2014thank a lot Ney. my nonin is 9560 Bluetooth model. do I need to connect all GND of rn42 to GND of mbed?
posted by Sami Alshorman 29 Sep 2014Hi sami, one question? youre using the rn42 chip itself or a breadboard rn-42 like bluesmirf ?
Greetings
posted by Ney Palma 29 Sep 2014hi ney. I am using rn42 chip itself.
posted by Sami Alshorman 29 Sep 2014Hi Sami, i will check the rn42 manual. Can you send me a picture of what is showing in the lcd. Have you try to send the replies over the serial port of the mbed to see if there is a problem perhaps of the lcd. I understand the connection with the nonin device is already made right?
posted by Ney Palma 29 Sep 2014HI Ney, always give me on LCD this decimal number (10,13, 63 and some times instead 63 it give me 100) that's mean it transmit 3 bits /s. one for status the second for pulse rate and the third for oxygen saturation. by the way I set up the rn42 module as the following . enable authentication, enable bonding, enable encryption. but the default setting for the device are all disable. I set up by using Tera Term software, but after I set this to enable now I can not open the tera term I mean it give me error since I use com 3. please comment
posted by Sami Alshorman 29 Sep 2014Hi Sami, please can you post pictures of the errors that youre having?
Greetings
posted by Ney Palma 02 Oct 2014/media/uploads/samialshorman/tera_term_error.docx hi Ney, it give me "can not open COM3
posted by Sami Alshorman 02 Oct 2014Hi Ney, any updates. Now I solved the COM3 issue but I can not connect to my remote it replay me <error-connected>
posted by Sami Alshorman 04 Oct 2014