We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]
Rating:
Author: MIKROE
Last Updated: 2020-05-01
Package Version: 1.0.0.1
mikroSDK Library: 1.0.0.0
Category: BT/BLE
Downloaded: 7696 times
Followed by: 1 user
License: MIT license
Example for Bluetooth2 click board in mikroBUS form factor. This expects a message from the Master (Bluetooth dongle, mobile phone, etc) and displays in on the Lcd.
Do you want to subscribe in order to receive notifications regarding "Bluetooth 2 click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "Bluetooth 2 click" changes.
Do you want to report abuse regarding "Bluetooth 2 click".
Library Description
The library covers all the necessary functions to control Bluetooth 2 Click board. A library performs the communication with the device via UART interface with WT41U-A Bluetooth 2 module.
Key functions:
void bluetooth2_write_byte ( uint8_t input )
- Write Single Byte.uint8_t bluetooth2_read_byte ( void )
- Read Single Byte.void bluetooth2_uart_write ( uint8_t *tx_data )
- UART write function.Examples description
The application is composed of three sections :
void application_task ( )
{
rx_dat = UART_Rdy_Ptr( );
if ( rx_dat )
{
rx_dat = UART_Rd_Ptr( );
check_rx( );
}
}
Additional Functions :
_strcpy
- Allows user to copy content of one string to second string, starting from the first place._strcmp
- Allows user to compare a content of two selected strings.prev_cmd
- Checks the character (Up, Down, Left, Right, Esc) that was entered by the user side.check_prev_cmd
- Determines which of 3 previous entered commands will be entered again.exe_cmd
- Compares an entered command with the predefined commands and if any of these commands is matched, then executes a desired operation.add_cmd_line
- Adds a new command line for entering new data/command/request.check_rx
- Executes a received character parsering, entered from the user side.Other mikroE Libraries used in the example:
Additional notes and informations
Depending on the development board you are using, you may need USB UART click, USB UART 2 click or RS232 click to connect to your PC, for development systems with no UART to USB interface available on the board. The terminal available in all MikroElektronika compilers, or any other terminal application of your choice, can be used to read the message.