TOP Contributors

  1. MIKROE (2656 codes)
  2. Alcides Ramos (353 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 (136785 times)
  2. FAT32 Library (69980 times)
  3. Network Ethernet Library (55951 times)
  4. USB Device Library (46274 times)
  5. Network WiFi Library (41889 times)
  6. FT800 Library (41184 times)
  7. GSM click (28988 times)
  8. PID Library (26420 times)
  9. mikroSDK (26374 times)
  10. microSD click (25382 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

H-Bridge 6 click

Rating:

5

Author: MIKROE

Last Updated: 2021-08-06

Package Version: 1.0.0.0

mikroSDK Library: 1.0.0.0

Category: Brushed

Downloaded: 1177 times

Not followed.

License: MIT license  

H-Bridge 6 Click is a compact add-on board that contains a DC motor driver for automotive applications. This board features the VNHD7008AY, an H-bridge motor driver for automotive DC motor driving from STMicroelectronics.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "H-Bridge 6 click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "H-Bridge 6 click" changes.

Do you want to report abuse regarding "H-Bridge 6 click".

  • mikroSDK Library 2.0.0.0
  • Comments (0)
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

H-Bridge 6 Click

H-Bridge 6 Click

Native view of the H-Bridge 6 Click board.

View full image
H-Bridge 6 Click

H-Bridge 6 Click

Front and back view of the H-Bridge 6 Click board.

View full image

Library Description

The library covers all the necessary functions to control the H-Bridge 6 Click board™. A library performs communication with the device via the I2C interface. Using the PWM function, we can adjust the engine speed and direction.

Key functions:

  • void hbridge6_generic_write ( uint8_t reg, uint8_t tx_data ) - Generic write function.
  • uint8_t hbridge6_generic_read ( uint8_t reg ) - Generic read function.
  • void hbridge6_set_direction ( uint8_t direction ) - Set the direction function.

Examples description

The application is composed of three sections :

  • System Initialization - Initializes I2C and start to write log.
  • Application Initialization - Initialization driver enables - I2C, reset the device and set default configuration, initialization and configure the PWM, also write log.
  • Application Task - (code snippet) This is an example that demonstrates the use of H-Bridge 6 Click board™. It shows moving in the clockwise direction of rotation and moving in the counterclockwise direction of rotation from slow to fast speed. All data logs write on USB uart changes.
void application_task ( )
{
    mikrobus_logWrite( "-----------------------", _LOG_LINE );
    mikrobus_logWrite( "       Clockwise       ", _LOG_LINE );
    hbridge6_set_direction( HBRIDGE6_DIRECTION_CLOCKWISE );
    pwm_duty_cycle = 100;
    
    while ( pwm_duty_cycle < ( pwm_max_duty / 3 ) )
    {
        pwm_duty_cycle += 50;
        mikrobus_logWrite( " >", _LOG_TEXT );
        hbridge6_pwm_set_duty( pwm_duty_cycle );
        Delay_ms( 100 );
    }
    
    mikrobus_logWrite( "", _LOG_LINE );
    mikrobus_logWrite( "-----------------------", _LOG_LINE );
    mikrobus_logWrite( "         Brake         ", _LOG_LINE );
    hbridge6_set_direction( HBRIDGE6_DIRECTION_BRAKE );
    Delay_ms( 3000 );

    mikrobus_logWrite( "-----------------------", _LOG_LINE );
    mikrobus_logWrite( "    Counterclockwise   ", _LOG_LINE );
    hbridge6_set_direction( HBRIDGE6_DIRECTION_COUNTERCLOCKWISE );
    pwm_duty_cycle = 100;
    Delay_ms( 1000 );

    while ( pwm_duty_cycle < ( pwm_max_duty / 3 ) )
    {
        pwm_duty_cycle += 50;
        mikrobus_logWrite( " <", _LOG_TEXT );
        hbridge6_pwm_set_duty( pwm_duty_cycle );
        Delay_ms( 100 );
    }
    
    mikrobus_logWrite( "", _LOG_LINE );
    mikrobus_logWrite( "-----------------------", _LOG_LINE );
    mikrobus_logWrite( "         Brake         ", _LOG_LINE );
    hbridge6_set_direction( HBRIDGE6_DIRECTION_BRAKE );
    Delay_ms( 1000 );
    
    hbridge6_pwm_stop( );
    Delay_ms( 2000 );
    hbridge6_pwm_start( );
    Delay_ms( 1000 );
}


 

  • uint32_t hbridge6_pwm_init ( uint16_t freq ) - Initializes the Timer module in PWM mode.
  • void hbridge6_pwm_set_duty ( uint16_t duty ) - The function changes PWM duty ratio.
  • void hbridge6_pwm_start( ) - Starts appropriate PWM module.
  • void hbridge6_pwm_stop( ) - Stops appropriate PWM module.

Other mikroE Libraries used in the example:

  • I2C
  • PWM
  • UART

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

HeartRate 8 click

5

Heart Rate 8 click is an optical biosensor Click board, designed for heart-rate monitoring (HRM). This Click board employs a specialized sensor that incorporates three LED drivers and two photo-sensing elements, sensitive to green and IR light.

[Learn More]

FT click

0

FT Click is a compact smart transceiver add-on board that helps you add a Free Topology (FT) interface to any host board with the mikroBUS™ socket. Leveraging FT, the most reliable and easiest-to-scale wired communications media, FT Click lets you network sensors and devices to create IoT solutions for automation and control networks that are easier to develop, integrate and install. This Click board™ supports full communication stacks for LON® and BACnet FT, as well as FTMQ (MQTT like messaging format) on board to simplify integration of BACnet, LON or custom IoT networks over twisted pair wire. FT Click is ideal for markets including smart buildings, cities, machines, agriculture, manufacturing, transportation and many more where wireless communications do not provide the required reliability and scale.

[Learn More]

Motion 3 click

5

Motion 3 Click is a Click board based on EKMC1606112, PIR motion sensor from Panasonic Corporation that's used as human motion detector.

[Learn More]