How to check if Bluetooth module works properly

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 6.

Moderator: Benj

Post Reply
xPavelx
Posts: 3
Joined: Mon Feb 27, 2017 9:59 pm
Contact:

How to check if Bluetooth module works properly

Post by xPavelx »

Hello everyone,
I have a multiprogrammer board with PIC 16F1937 and LCD and Bluetooth modules connected to the board.
The question is how I am to check whether the Bluetooth module works correctly? I want a message to be displayed on the LCD if the Bluetooth module functions in a proper way.
I tried using the SendScript macro with the following script and set the return value to a variable EXAMPLE:
ATS0=1
ATS536=1
ATS512=4
AT+BTK="1234"
AT&W
ATZ
According to the Flowcode wiki, if the return value is equal to 0, the script has been executed successfully, but if it equals 1, then there are some mistakes.
Nevertheless, when I unattached the bluetooth module, the return value was still 0.
Thus I can't say how to check whether the bluetooth module has been detected and works fine because 0 is returned in either case (with or without bluetooth board attached).
Please help!

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: How to check if Bluetooth module works properly

Post by LeighM »

One useful AT command is ATI4 as this returns the 12 digit hexadecimal Bluetooth module address.

Code: Select all

CreateCommandString("ATI4")
SendCommand(1,1)
reply_length = StringReceive()
if reply_length > 0 .... read the string
For help and examples of using the Bluetooth component, see these WiKi pages ..
http://www.matrixtsl.com/wikiv7/index.p ... b119c5f7a7
http://www.matrixtsl.com/wikiv7/index.p ... tion_Guide

xPavelx
Posts: 3
Joined: Mon Feb 27, 2017 9:59 pm
Contact:

Re: How to check if Bluetooth module works properly

Post by xPavelx »

LeighM, thanks for your piece of advice!
But I couldn't make that piece of code work. I've attached the screenshot with a flowcode chart https://pp.userapi.com/c639720/v6397205 ... xe0sRI.jpg
What am I to change in it?
Thanks in advance!

Post Reply