TOP Contributors

  1. MIKROE (2638 codes)
  2. Alcides Ramos (347 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 (136093 times)
  2. FAT32 Library (69395 times)
  3. Network Ethernet Library (55671 times)
  4. USB Device Library (45937 times)
  5. Network WiFi Library (41606 times)
  6. FT800 Library (40699 times)
  7. GSM click (28759 times)
  8. PID Library (26312 times)
  9. mikroSDK (25990 times)
  10. microSD click (25088 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: 6929 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

LED Driver 7 click

0

LED Driver 7 click is a Click board™ equipped with the LTC3490, single cell 350mA LED driver from Analog Devices.

[Learn More]

Hall Current 2 click

0

Hall current 2 click is a very accurate current measurement Click board™, which relies on the Hall effect.

[Learn More]

UWB click

5

UWB Click is an Ultra-Wideband transceiver Click board that can be used in 2-way ranging or TDOA location systems to locate assets to a precision of 10 cm and supports data rates of up to 6.8 Mbps. This board features the DWM1000 module based on Decawave's DW1000 Ultra-Wideband (UWB) transceiver from Decawave Limited.

[Learn More]