bluetooth eblock connection
Moderator: Benj
-
- Flowcode V4 User
- Posts: 36
- Joined: Tue Mar 01, 2011 7:51 am
- Has thanked: 7 times
- Been thanked: 1 time
Re: bluetooth eblock connection
Hi,
David thanks for sorting out this thread for me,
Ben thanks for the reply,
I am just wondering that if for what i want to accomplish should I have to fiddle with the AT commands in the bluetooth macro as I am able to connect my code to hyperterm but hyperterm has never responded to commands, like AT returning OK?
Thanks
Stephen
David thanks for sorting out this thread for me,
Ben thanks for the reply,
I am just wondering that if for what i want to accomplish should I have to fiddle with the AT commands in the bluetooth macro as I am able to connect my code to hyperterm but hyperterm has never responded to commands, like AT returning OK?
Thanks
Stephen
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: bluetooth eblock connection
Hello,
I'm not sure if you can send AT commands via the wireless. Eg via hyperterminal. Have you tried connecting to the other COM port that is provided when installing the remote bluetooth device.
I'm not sure if you can send AT commands via the wireless. Eg via hyperterminal. Have you tried connecting to the other COM port that is provided when installing the remote bluetooth device.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Flowcode V4 User
- Posts: 36
- Joined: Tue Mar 01, 2011 7:51 am
- Has thanked: 7 times
- Been thanked: 1 time
Re: bluetooth eblock connection
Hi Ben,
Yes I tried the other COM port it connects, but i dont think to the bluetooth component as the LED on the component does not light.
The first thing i done to my code was include a bluetooth initilize command, followed by send script 1. It works it allowed a conection.
Funnnily enough i just threw in a creat command and a send command loaded both with the same value and compiled to the chip to see if hyperterminal would react. It did. With a smiley face.. So atleast I know its capable of getting some reaction to my code.
I am just wondering now for the send command should the bExpectEcho(BYTE) value be the same as the bExpectCR(BYTE) value?
I had a look at some example programs but thry mainly seem to be using strings.
Thanks
Stephen
Yes I tried the other COM port it connects, but i dont think to the bluetooth component as the LED on the component does not light.
The first thing i done to my code was include a bluetooth initilize command, followed by send script 1. It works it allowed a conection.
Funnnily enough i just threw in a creat command and a send command loaded both with the same value and compiled to the chip to see if hyperterminal would react. It did. With a smiley face.. So atleast I know its capable of getting some reaction to my code.
I am just wondering now for the send command should the bExpectEcho(BYTE) value be the same as the bExpectCR(BYTE) value?
I had a look at some example programs but thry mainly seem to be using strings.
Thanks
Stephen
-
- Flowcode V4 User
- Posts: 36
- Joined: Tue Mar 01, 2011 7:51 am
- Has thanked: 7 times
- Been thanked: 1 time
Re: bluetooth eblock connection
Hi Ben,
I have a set up the Bluetooth and i can now communicate with hyperterm i can send a message to hyper term saying ""YOUR_HEART_RATE=" followed by the BPM value, the problem is instead of printing a number it prints a symbol i.e instead of "YOUR_HEART_RATE=6" it prints "!", any idea on how i can fix this, i am sending the BPM value as a byte, but it is the same case when i send as an int?
Thanks
Stephen
I have a set up the Bluetooth and i can now communicate with hyperterm i can send a message to hyper term saying ""YOUR_HEART_RATE=" followed by the BPM value, the problem is instead of printing a number it prints a symbol i.e instead of "YOUR_HEART_RATE=6" it prints "!", any idea on how i can fix this, i am sending the BPM value as a byte, but it is the same case when i send as an int?
Thanks
Stephen
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: bluetooth eblock connection
Hello Stephen,
Ok here you will need to convert your numeric byte into a string representing the number you wish to send.
On the PIC you can do this using the string manipulation icon and the ToString function. You would then simply send the string over the bluetooth rather then the byte variable.
Ok here you will need to convert your numeric byte into a string representing the number you wish to send.
On the PIC you can do this using the string manipulation icon and the ToString function. You would then simply send the string over the bluetooth rather then the byte variable.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Flowcode V4 User
- Posts: 36
- Joined: Tue Mar 01, 2011 7:51 am
- Has thanked: 7 times
- Been thanked: 1 time
Re: bluetooth eblock connection
Hi Ben,
Thanks for the reply, I have converted my value to a string, however i cannot find parameter in the bluetooth macro that accepts strings? Am i missing something?
As far as I know string receive and string send is the correct way too send strings.
Thanks,
Stephen
Thanks for the reply, I have converted my value to a string, however i cannot find parameter in the bluetooth macro that accepts strings? Am i missing something?
As far as I know string receive and string send is the correct way too send strings.
Thanks,
Stephen
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: bluetooth eblock connection
Hello,
Ah yes you are correct you can only send a byte at a time using the Bluetooth component.
In this cas eyou will have to convert the number to a string as detailed previously and then output the string to the Bluetooth a byte at a time.
To do this you simply create two byte variables, one to hold the length of the string and the other to hold the current position in the string.
To read the string length use the length function available from the string manipulation icon.
Once you have the string length initialise your position variable to 0 and then enter a loop while position < length.
Inside the loop to send a byte from the string you can use this syntax.
string[position]
then increment the position byte.
position = position + 1
Ah yes you are correct you can only send a byte at a time using the Bluetooth component.
In this cas eyou will have to convert the number to a string as detailed previously and then output the string to the Bluetooth a byte at a time.
To do this you simply create two byte variables, one to hold the length of the string and the other to hold the current position in the string.
To read the string length use the length function available from the string manipulation icon.
Once you have the string length initialise your position variable to 0 and then enter a loop while position < length.
Inside the loop to send a byte from the string you can use this syntax.
string[position]
then increment the position byte.
position = position + 1
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Flowcode V4 User
- Posts: 36
- Joined: Tue Mar 01, 2011 7:51 am
- Has thanked: 7 times
- Been thanked: 1 time
Re: bluetooth eblock connection
Hi Ben,
I just seen your reply, I actually tried somnething similar to what you outlined , last night, But I was not succesful. I even tried shouting at it...... this didnt work either
I noticed the bluetooth is very sensitive to the send command if i set it up in a way it dosent like it will refuse to connect to hyperterminal atall,
I just tried implementing your idea but I dont think I have it quiet right, could you please view the attached code and let me know what corrections I need to make?
Thanks
Stephen
I just seen your reply, I actually tried somnething similar to what you outlined , last night, But I was not succesful. I even tried shouting at it...... this didnt work either

I noticed the bluetooth is very sensitive to the send command if i set it up in a way it dosent like it will refuse to connect to hyperterminal atall,
I just tried implementing your idea but I dont think I have it quiet right, could you please view the attached code and let me know what corrections I need to make?
Thanks
Stephen
- Attachments
-
- smc_FYP_18F488.fcf
- (17 KiB) Downloaded 317 times
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: bluetooth eblock connection
Hello Stephen,
I have made amendments to your file and it should work correctly now.
I have made amendments to your file and it should work correctly now.
- Attachments
-
- smc_FYP_18F488.fcf
- (17 KiB) Downloaded 321 times
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Flowcode V4 User
- Posts: 36
- Joined: Tue Mar 01, 2011 7:51 am
- Has thanked: 7 times
- Been thanked: 1 time
Re: bluetooth eblock connection
Hi Ben
Thanks yet again for another quick reply,
I just downloaded your updated code and cleaned up the send command and now it works.
Thanks very much for your time, there is no way I would have managed to get the bluetooth component working with your help,
I will keep this thread up to date on the progress of this project over the coming weeks,
Thanks again!!
Stephen
Thanks yet again for another quick reply,
I just downloaded your updated code and cleaned up the send command and now it works.
Thanks very much for your time, there is no way I would have managed to get the bluetooth component working with your help,
I will keep this thread up to date on the progress of this project over the coming weeks,
Thanks again!!
Stephen