HM-10
The following example shows how to connect GUI-O application with HM-10 in Bluetooth Low Energy (BLE) mode.
HM-10 BLE & Arduino & GUI-O basic example
The following example shows how to connect GUI-O application with HM-10 Bluetooth Low Energy (BLE) module. Arduino Uno is used as an intermediary between the HM-10 and PC serial terminal.
Prerequisites
Download Arduino IDE
Download BLE_HM-10.ino sketch
Step 1: Connect the components
Connect the components as shown in the schematic below. Note that the Arduino Uno transmit pin (pin "D3") uses a voltage divider to reduce 5V to roughly 3.3V.
Step 2: Upload the code
Open Arduino IDE
Select "File -> Open"
Navigate to location, where BLE_HM-10.ino sketch was downloaded
Select BLE_HM-10.ino and confirm
Make sure that Arduino Uno board is selected and connected to your PC
Make sure the correct port is selected
Press upload button to start code upload
Step 3: Connect GUI-O application with HM-10
Open GUI-O application, navigate to settings and select "Connections -> Bluetooth LE"
Search for BLE devices (enable Bluetooth and Location services, if prompted)
Select HM-10 module (named HMSoft or similar)
Wait for successful connection
Open any serial terminal on PC (e.g., Arduino Serial Monitor)
Press the GUI-O initialize button and observe the result on serial terminal on PC
Send any valid command (see example below) via serial terminal on PC and observe the result in GUI-O application
EXAMPLE COMMAND: "|TG UID:toggle X:50 Y:50" (omitting the quotes). Make sure all commands are terminated by carriage return (\r) and line feed (\n). See the GUI-O manual for all supported commands.
Important notes
HM-10 module has its own internal status handling and sends OK+CONN (when connection is established) or OK+LOST (when connection is lost. These messages are not terminated by carriage return (\r) or line feed (\n), so this can possibly interfere with GUI-O protocol. It is therefore recommended to parse all messages by the GUI-O specific character ('@'). Character '@' is always prepended to any GUI-O protocol message.
Connect . Create . Control