TOP Contributors

  1. MIKROE (2650 codes)
  2. Alcides Ramos (350 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (112 codes)
  5. Chisanga Mumba (90 codes)
  6. S P (73 codes)
  7. dany (71 codes)
  8. MikroBUS.NET Team (35 codes)
  9. NART SCHINACKOW (34 codes)
  10. Armstrong Subero (27 codes)

Most Downloaded

  1. Timer Calculator (136546 times)
  2. FAT32 Library (69740 times)
  3. Network Ethernet Library (55845 times)
  4. USB Device Library (46184 times)
  5. Network WiFi Library (41803 times)
  6. FT800 Library (40991 times)
  7. GSM click (28926 times)
  8. PID Library (26385 times)
  9. mikroSDK (26287 times)
  10. microSD click (25300 times)
Libstock prefers package manager

Package Manager

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]

< Back
mikroSDK Library

Bluetooth 2 click

Rating:

0

Author: MIKROE

Last Updated: 2020-05-01

Package Version: 1.0.0.1

mikroSDK Library: 1.0.0.0

Category: BT/BLE

Downloaded: 7017 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.

No Abuse Reported

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".

DOWNLOAD LINK RELATED COMPILER CONTAINS
mikroBasic PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc

mikroSDK Library Blog

Bluetooth 2 click

Bluetooth 2 click

Native view of the Bluetooth 2 Click board.

View full image
Bluetooth 2 click

Bluetooth 2 click

Front and back view of the Bluetooth 2 Click board.

View full image

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 :

  • System Initialization - Initializes peripherals and pins.
  • Application Initialization - Initializes UART serial interface, UART interrupt, and write log.
  • Application Task - (code snippet) - This function allows user to enter a commands, module configurations, data which will be transmitted, and also to check all module and connection status by using the serial terminal. Note: XX:XX:XX:XX:XX:XX replace with your device's Bluetooth address. Special commands: Press 'Enter' when you want to send the entered command (data). Press 'Backspace' to delete the wrong entered character before you send the command. Press 'Up-Down' or 'Left-Right' to see and enter a 3 last sent commands. Press 'Esc' and then 'r' character to perform a hardware reset via RST pin. The second segment allows user to read and check response from the SIM868 module when the response is ready.
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:

  • UART
  • Conversions

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.

ALSO FROM THIS AUTHOR

6DOF IMU 8 click

5

6DOF IMU 8 click is an advanced 6-axis motion tracking Click board, which utilizes the ISM330DLC, a high-performance System in Package (SiP), equipped with a 3-axis gyroscope, and a 3-axis accelerometer.

[Learn More]

RTC for STM32F2xx/3xx/4xx

7

RTC package for STM32F2xx/3xx/4xx mcus. In the package you can find source for library and example how to use RTC with alarms. Library and example written by Nikola Markovic from our Intern's lab.

[Learn More]

Temp-Hum 9 click

5

Temp-Hum 9 click is a smart temperature and humidity sensing click board, packed with features that allow simple integration into any design.

[Learn More]