TOP Contributors

  1. MIKROE (2653 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 (136652 times)
  2. FAT32 Library (69871 times)
  3. Network Ethernet Library (55903 times)
  4. USB Device Library (46245 times)
  5. Network WiFi Library (41873 times)
  6. FT800 Library (41115 times)
  7. GSM click (28968 times)
  8. PID Library (26403 times)
  9. mikroSDK (26331 times)
  10. microSD click (25345 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

Current Limit click

5

Current Limit Click is a compact add-on board that contains a low-voltage, P-channel MOSFET power switch intended for high-side load switching applications. This board features the MAX890L, a low-resistance power switch with the adjustable, accurate current limit system, and thermal shutdown from Maxim Integrated.

[Learn More]

Opto Encoder 3 click

5

Opto Encoder 3 Click is a linear incremental optical sensor/encoder click, which can be used for the movement or rotation encoding.

[Learn More]

Current Limit 7 click

0

Current Limit 7 Click is a compact add-on board representing a current-limiting solution. This board features the MAX14575A, an adjustable current-limit switch from Analog Devices. This Click board™ features internal current limiting to prevent damage to host devices due to faulty load conditions, has a low 32mΩ on-resistance, and operates from a 2.3V to 5.5V input voltage range. Also, the current limit is adjustable from 250mA to 2.5A programmed through AD5272 digital rheostat and set via onboard range switch. This Click board™ is suitable for applications in portable equipment and condition monitoring or power supplies, protecting them in short circuits or other overload conditions.

[Learn More]