8 years, 9 months ago.

sOURCE cODE qUESTIONS

Hi,

I had a complier issues as stated that identifier PA_13 and PA_14 is undefined. What is happening? sry as I am not a very good programmer.

Serial pc(USBTX, USBRX); Serial bt(PA_14, PA_13);

Secondly, from the source code it seems like from the code below, why is there a need for 2 baud rate settings?

pc.baud(115200); bt.baud(115200);

Many Thx

Question relating to:

Hi

Compiler is a success with me, no warnings or issues. HC-05_S2B_HelloWorld_WIZwiki-W7500/main.cpp;

1st Serial to PC : Serial pc(USBTX, USBRX); 2nd Serial to BT : Serial bt(PA_14, PA_13);

I think Serial bt( PA_14, PA_13 ) is in fact RX /TX or TX/RX pins.

Two baud rates one for each, PC & BT devices.

posted by Mark Edgar 09 Mar 2016

2 Answers

8 years, 9 months ago.

What developer kit are you using ¿

I am using LPC1768 with HC 05.....

posted by t t 09 Mar 2016

The LPC1768 doesn't have any pins called PA_13 or PA_14 which is why you get an error. On that board they are p5-p30, which pin is which is here. If using them for a serial port then you need to use pins that are marked as rx and tx on the same UART e.g.

Serial bt(p9,p10)

As Mark indicated above, the two baud rates are because you have two serial ports, the bluetooth and the USB to the PC.

posted by Andy A 09 Mar 2016

thx for the tips, will give it a try....cheers

posted by t t 10 Mar 2016
8 years, 8 months ago.

Keep in mind that HC-05 and similars come with a default baud rate of 9600, not the 115200, so it is possible that this example does not work until you change the baud rate to 115200.