Component: Bluetooth (HC05 / HC06) (Wireless): Difference between revisions
Appearance
No edit summary |
m Text replacement - "style="background-color:#EAE1EA;"" to "class="mtx-class-propfolder"" |
||
| (7 intermediate revisions by 2 users not shown) | |||
| Line 17: | Line 17: | ||
==Component Source Code== | ==Component Source Code== | ||
Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/ | Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_BTHC05.fcfx FC_Comp_Source_BTHC05.fcfx] | ||
Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/ | Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_BTHC05.fcfx FC_Comp_Source_BTHC05.fcfx] | ||
==Detailed description== | ==Detailed description== | ||
| Line 82: | Line 82: | ||
Outgoing data is assigned and sent using a keypad component. | Outgoing data is assigned and sent using a keypad component. | ||
{{Fcfile|HC05_Example.fcfx|HC05 Example}} | {{Fcfile|HC05_Example.fcfx|HC05 Example}} | ||
| Line 92: | Line 96: | ||
===Initialise=== | ===Initialise=== | ||
{| class="wikitable | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''Initialise''' | ||
|- | |- | ||
| colspan="2" | Sets up the RS232 peripheral, must be called at the start of your program or at least before you start calling any other RS232 macros. | | colspan="2" | Sets up the RS232 peripheral, must be called at the start of your program or at least before you start calling any other RS232 macros. | ||
| Line 106: | Line 110: | ||
===ReceiveChar=== | ===ReceiveChar=== | ||
{| class="wikitable | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''ReceiveChar''' | ||
|- | |- | ||
| colspan="2" | Attempts to receive a single packet from the UART interface. | | colspan="2" | Attempts to receive a single packet from the UART interface. | ||
| Line 125: | Line 129: | ||
===ReceiveString=== | ===ReceiveString=== | ||
{| class="wikitable | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''ReceiveString''' | ||
|- | |- | ||
| colspan="2" | Attempts to receive a string of bytes from the UART interface. | | colspan="2" | Attempts to receive a string of bytes from the UART interface. | ||
| Line 149: | Line 153: | ||
===SendChar=== | ===SendChar=== | ||
{| class="wikitable | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''SendChar''' | ||
|- | |- | ||
| colspan="2" | Sends out a single packet from the UART interface. | | colspan="2" | Sends out a single packet from the UART interface. | ||
| Line 168: | Line 172: | ||
===SendCommand=== | ===SendCommand=== | ||
{| class="wikitable | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''SendCommand''' | ||
|- | |- | ||
| colspan="2" | Sends a command string to the HC05/HC06 module. | | colspan="2" | Sends a command string to the HC05/HC06 module. | ||
| Line 187: | Line 191: | ||
===SendNumber=== | ===SendNumber=== | ||
{| class="wikitable | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''SendNumber''' | ||
|- | |- | ||
| colspan="2" | Sends out a number as an ASCII String from the UART interface. | | colspan="2" | Sends out a number as an ASCII String from the UART interface. | ||
| Line 206: | Line 210: | ||
===SendString=== | ===SendString=== | ||
{| class="wikitable | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''SendString''' | ||
|- | |- | ||
| colspan="2" | Sends out a string of bytes from the UART interface. | | colspan="2" | Sends out a string of bytes from the UART interface. | ||
| Line 225: | Line 229: | ||
===SetBaud=== | ===SetBaud=== | ||
{| class="wikitable | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''SetBaud''' | ||
|- | |- | ||
| colspan="2" | Sets the Bluetooth baud rate stored in the Bluetooth module's ROM. Commands must be sent before Bluetooth communications are estabished e.g. right after power on and initialisation. | | colspan="2" | Sets the Bluetooth baud rate stored in the Bluetooth module's ROM. Commands must be sent before Bluetooth communications are estabished e.g. right after power on and initialisation. | ||
| Line 244: | Line 248: | ||
===SetName=== | ===SetName=== | ||
{| class="wikitable | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''SetName''' | ||
|- | |- | ||
| colspan="2" | Sets the Bluetooth Friendly name stored in the Bluetooth module's ROM. Commands must be sent before Bluetooth communications are estabished e.g. right after power on and initialisation. | | colspan="2" | Sets the Bluetooth Friendly name stored in the Bluetooth module's ROM. Commands must be sent before Bluetooth communications are estabished e.g. right after power on and initialisation. | ||
| Line 263: | Line 267: | ||
===SetPairKey=== | ===SetPairKey=== | ||
{| class="wikitable | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''SetPairKey''' | ||
|- | |- | ||
| colspan="2" | Sets the Bluetooth pair key stored in the Bluetooth module's ROM. Commands must be sent before Bluetooth communications are estabished e.g. right after power on and initialisation. | | colspan="2" | Sets the Bluetooth pair key stored in the Bluetooth module's ROM. Commands must be sent before Bluetooth communications are estabished e.g. right after power on and initialisation. | ||
| Line 279: | Line 283: | ||
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
==Property reference== | ==Property reference== | ||
{| class="wikitable | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-prop-icon.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''Properties''' | ||
|- | |- | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]] | ||
| width="90%" | | width="90%" class="mtx-class-propfolder" | Comms Settings | ||
|- | |- | ||
|- | |- | ||
| Line 320: | Line 322: | ||
| colspan="2" | | | colspan="2" | | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]] | ||
| width="90%" | | width="90%" class="mtx-class-propfolder" | Connections | ||
|- | |- | ||
|- | |- | ||
| Line 354: | Line 356: | ||
| colspan="2" | Flow Control (Handshake) enable or disable. On: Two I/O pins are used to control the flow of data in and out of the device. Off: Flow control is disabled. | | colspan="2" | Flow Control (Handshake) enable or disable. On: Two I/O pins are used to control the flow of data in and out of the device. Off: Flow control is disabled. | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]] | ||
| width="90%" | | width="90%" class="mtx-class-propfolder" | Simulation | ||
|- | |- | ||
|- | |- | ||
Latest revision as of 14:37, 13 July 2026
| Author | Matrix Ltd |
| Version | 2.1 |
| Category | Wireless |
Bluetooth (HC05 / HC06) component
Low level routines for controlling or interacting with a HC05 or HC06 Bluetooth module. Contains functions to allow the baud rate, bluetooth name and bluetooth key to be defined.
Component Source Code
Please click here to download the component source project: FC_Comp_Source_BTHC05.fcfx
Please click here to view the component source code (Beta): FC_Comp_Source_BTHC05.fcfx
Detailed description
No detailed description exists yet for this component
Examples
Example Program that configures a HC05 / HC06 Bluetooth module and then allows a data connection to be established and utilised.
Incoming data will be displayed on an LCD.
Outgoing data is assigned and sent using a keypad component.
HC05 Example
Macro reference
Initialise
| Initialise | |
| Sets up the RS232 peripheral, must be called at the start of your program or at least before you start calling any other RS232 macros. | |
| Return | |
ReceiveChar
| ReceiveChar | |
| Attempts to receive a single packet from the UART interface. | |
| Timeout | |
| Time to wait for valid data before returning, 0=Dont wait, 255=Wait forever. | |
| Return | |
ReceiveString
| ReceiveString | |
| Attempts to receive a string of bytes from the UART interface. | |
| Timeout | |
| NumBytes | |
| Return | |
SendChar
| SendChar | |
| Sends out a single packet from the UART interface. | |
| Char | |
| Return | |
SendCommand
| SendCommand | |
| Sends a command string to the HC05/HC06 module. | |
| Command | |
| Return | |
SendNumber
| SendNumber | |
| Sends out a number as an ASCII String from the UART interface. | |
| [[File:]] - | Number |
| Return | |
SendString
| SendString | |
| Sends out a string of bytes from the UART interface. | |
| Data | |
| Return | |
SetBaud
SetName
SetPairKey