TOP Contributors

  1. MIKROE (2652 codes)
  2. Alcides Ramos (351 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 (136636 times)
  2. FAT32 Library (69842 times)
  3. Network Ethernet Library (55893 times)
  4. USB Device Library (46227 times)
  5. Network WiFi Library (41866 times)
  6. FT800 Library (41087 times)
  7. GSM click (28945 times)
  8. PID Library (26402 times)
  9. mikroSDK (26318 times)
  10. microSD click (25329 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: 7028 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

Binho Nova click

0

Binho Nova Click is an adapter Click board™ that can be used as a multi-protocol adapter. This board features two female 1.27mm 2x5 connectors suitable for connecting the Binho Nova Multi-Protocol USB Host Adapter depending on the desired interface. This Click board™ is designed for ultimate flexibility and provides the ability to use this adapter with different communication protocols, such as I2C, SPI, or UART. It features five signal pins, which can be used as Digital Input/Output, PWM Output, Digital Interrupt, or Analog Input/Output. Along with these connectors, it also features two power jumpers that can be used to supply the host from the Binho Nova.

[Learn More]

Magnetic Rotary 2 click

0

Magnetic Rotary 2 Click is a compact add-on board used for accurate magnet-position sensing. This board features the AEAT-9922, an angular magnetic rotary sensor providing accurate angular measurement over a full 360 degrees of rotation from Broadcom Limited. The AEAT-9922 uses integrated Hall sensor elements with complex analog and digital signal processing within a single device. The absolute angle measurement provides an instant indication of the magnet's angular position with a selectable and one-time programmable resolution from 10 to 18 bits.

[Learn More]

LED Driver 18 click

0

LED Driver 18 Click is a compact add-on board that simplifies the control of multiple LEDs. This board features the TLC5947, a 24-channel LED driver from Texas Instruments. Each channel is individually adjustable with 4096 pulse-width modulated (PWM) steps and has a programmable current value of all channels with a maximum of 30mA of LED current per channel.

[Learn More]