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 (136537 times)
  2. FAT32 Library (69730 times)
  3. Network Ethernet Library (55839 times)
  4. USB Device Library (46170 times)
  5. Network WiFi Library (41799 times)
  6. FT800 Library (40985 times)
  7. GSM click (28921 times)
  8. PID Library (26383 times)
  9. mikroSDK (26277 times)
  10. microSD click (25297 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

BLE 5 click

Rating:

5

Author: MIKROE

Last Updated: 2020-05-29

Package Version: 1.0.0.0

mikroSDK Library: 1.0.0.0

Category: BT/BLE

Downloaded: 1438 times

Not followed.

License: MIT license  

The BLE 5 Click is a Click board witch provide BT/BLE connectivity for any embedded application. BLE 5 click based on the PAN1760A, a module from Panasonic. The Click board with small Bluetooth Low Energy module for easy integration of Bluetooth Low Energy connectivity (BLE) into various electronic devices.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "BLE 5 click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "BLE 5 click" changes.

Do you want to report abuse regarding "BLE 5 click".

  • Information
  • Comments (0)

mikroSDK Library Blog

BLE 5 Click

BLE 5 Click

Native view of the BLE 5 Click board.

View full image
BLE 5 Click

BLE 5 Click

Front and back view of the BLE 5 Click board.

View full image

Library Description

The library covers all the necessary functions to control BLE 5 Click board. A library performs the communication with the PAN1760 Series Bluetooth Low Energy RF Module via UART interface.

Key functions:

  • void ble5_device_reset ( void ) - Device reset function.
  • void ble5_send_at_command ( uint8_t *at_command, uint32_t at_command_length ) - Send AT command function.

Examples description

The application is composed of three sections :

  • System Initialization - Initializes UART, sets INT pin as input and AN, RST, CS and PWM pin as outputs and begins to write log.
  • Application Initialization - Initialization driver enables - UART, sets handlers, initializes and enables UART interrupt, reset and configures BLE module, initialize BLE Server Profile ( Services and Characteristics ).
  • Application Task - (code snippet) This example demonstrates the use of BLE 5 Click board. The app starts by checking system ready flag and returns Bluetooth device address. After that, the chain of commands creates Primary Server Profiles: Device Information, Generic Access and Custom Service to Start Advertising. For transmit and receive messages, we use Generic Access Primary Service with Read and Write permissions of the characteristic Element. Read: Message has been received, alias name value: "mikroE". Write: A transmit message ( the maximum 15 characters ). Results are being sent to the Usart Terminal where you can track their changes.

Note: For communication with BLE 5 click use the android application on the link: https://play.google.com/store/apps/details?id=com.macdom.ble.blescanner

void application_task ( )
{
    if ( ble5_response_ready( ) == 1 )
    {
        ble5_process( );

        if ( msg_flg == 1 )
        {
            msg_flg = 0;
        }
    }

    if ( device_disconnected_flag == 1 )
    {
        ble5_start_advertising ( );

        device_disconnected_flag = 0;
    }

    if ( serverread_flag == 1 )
    {
        ble5_upd_val( serverread_profile, serverread_characteristic, serverread_element );
        while ( ble5_response_ready( ) == 0 );
        ble5_process( );

        if ( msg_flg == 1 )
        {
            msg_flg = 0;
        }

        ble5_accept_rx_val( serverread_profile, serverread_characteristic, serverread_element );
        while ( ble5_response_ready( ) == 0 );
        ble5_process( );

        if ( msg_flg == 1 )
        {
            msg_flg = 0;
        }

        serverread_flag = 0;
    }

    if ( serverwrite_flag == 1 )
    {
        ble5_send_request_to_write( );
        while ( ble5_response_ready( ) == 0 );
        ble5_process( );

        if ( msg_flg == 1 )
        {
            msg_flg = 0;
        }

        serverwrite_flag = 0;
    }
}


Other mikroE Libraries used in the example:

  • ble5_check_ok - Check ok response.
  • ble5_default_handler - Default handler.
  • ble5_event_handler - Event handler.
  • ble5_error_handler - Error handler.
  • ble5_check_sys_rdy - Checks is system ready.
  • ble5_check_sw_ver - Checks software version.
  • ble5_log_bt_addr - Log Bluetooth device address.
  • ble5_upd_val - Updates the value of the given characteristic or descriptor.
  • ble5_accept_rx_val - Accepting and updating the value to database.
  • ble5_send_request_to_write - Sends request to write a char. or descriptor.
  • ble5_start_advertising - Start advertising.
  • ble5_create_service - Chain of commands creates Primary Server Profiles.
  • ble5_add_service - Add Server characteristic.

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 clickUSB 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

Stepper 8 click

0

Stepper 8 Click is a motor control add on board based on TC78H670FTG from Toshiba, a clock-in and serial controlled Bipolar Stepping Motor Driver which can drive a 128 micro-stepping motor with a power supply ranging from 2.5V to 16V for wide range of applications includes USB-powered, battery-powered, and standard 9-12V system devices. A perfect solution for driving stepper motors in security cameras, portable printers, handheld scanners, pico-projectors, smartphones and many more.

[Learn More]

LED Driver 12 click

0

LED Driver 12 Click is a compact add-on board that simplifies the control of multiple LEDs. This board features the PCA9532, a 16-bit I2C-configurable I/O expander optimized for dimming LEDs in 256 discrete Red/Green/Blue (RGB) steps from NXP Semiconductors. The PCA9532 offers high efficiency, supporting up to 16 LED channels and delivering a maximum of up to 25mA of LED current per channel. It contains an internal oscillator with two user-programmable blink rates and duty cycles coupled to the output PWM. Any bits not used for controlling the LEDs can be used for GPIO expansion, which provides a simple solution when additional I/O is needed for some sensors, push-buttons, or alarm monitoring. This Click board™ is suitable for color mixing and backlight application for amusement products, LED status signalization, home automation projects, and many more.

[Learn More]

RTC 9 click

5

RTC 9 Click is a real-time clock module which has an extremely low power consumption, allowing it to be used with a single button cell battery, for an extended period of time. This board features the M41T82, real-time clock (RTC) with battery switchover, from ST Microelectronics.

[Learn More]