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 4 click

Rating:

5

Author: MIKROE

Last Updated: 2019-10-25

Package Version: 1.0.0.0

mikroSDK Library: 1.0.0.0

Category: Brushed

Downloaded: 2896 times

Not followed.

License: MIT license  

H-Bridge 4 Click is a Click board that contains the AP1010AEN, which is a two channel H-Bridge motor driver compatible with a motor operating voltage up to 18V and can drive two DC motors or one stepper motor.

No Abuse Reported

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

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

Do you want to report abuse regarding "H-Bridge 4 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 4 Click

H-Bridge 4 Click

Native view of the H-Bridge 4 Click board.

View full image
H-Bridge 4 Click

H-Bridge 4 Click

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

View full image

Library Description

The library covers all the necessary functions to control H-Bridge 4 click board. The H-Bridge 4 click communicates with the target board through the AN, INT, PWM, RST and CS lines on MikroBUS. This library offers functions for setting or clearing of any and every of the five pins used for communication, also user can use functions that enable or disable clockwise or counter-clockwise motion, as well as standby mode and brake for both channels.

Key functions:

  • void hbridge4_motorAStandby() - Function is used to put motor A into standby.
  • void hbridge4_motorACW() - Function is used to put motor A into clockwise motion.
  • void hbridge4_motorABrake() - Function is used to brake motor A to a halt.

Examples description

The application is composed of three sections :

  • System Initialization - Initializes GPIO and LOG structures, sets AN, INT, PWM, RST and CS pins as output.
  • Application Initialization - Initialization driver enables GPIO and also starts write log.
  • Application Task - (code snippet) This example demonstrates the use of H-Bridge 4 click board by putting A motor in standby mode, then spining it in clockwise direction and applying brake function, and then spining it in counter-clockwise direction and applying brake function again.
void applicationTask()
{
    mikrobus_logWrite( "The motor A is in standby mode", _LOG_LINE );
    hbridge4_motorAStandby();
    Delay_ms( 100 );
    mikrobus_logWrite( "The motor A turns clockwise", _LOG_LINE );
    hbridge4_motorACW();
    Delay_ms( 2000 );
    mikrobus_logWrite( "The motor A applies brake", _LOG_LINE );
    hbridge4_motorABrake();
    Delay_ms( 1000 );
    mikrobus_logWrite( "The motor A turns counter-clockwise", _LOG_LINE );
    hbridge4_motorACCW();
    Delay_ms( 2000 );
    mikrobus_logWrite( "The motor A applies brake", _LOG_LINE );
    hbridge4_motorABrake();
    Delay_ms( 1000 );
}

Other mikroE Libraries used in the example:

  • 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

MAGNETO 4 click

5

Magneto 4 click is a high-resolution magnetic encoder Click board which allows contactless movement sensing down to 0.5µm. It features the AS5311, the complete integrated solution with Hall elements, low-noise analog front-end, and digital signal processing (DSP) sections, on the same die.

[Learn More]

4-20mA R click

0

Example demonstrates communication via 4-20mA interface. It measures current received from host (4-20mA T click). Temperature value and measured current are displayed via UART.

[Learn More]

AccelPressure click

0

Accel&Pressure Click is a compact add-on board representing a rate-of-climb sensing solution for your application. This board features the FXLS8974CF, a 3-axis low-g accelerometer, and the MPL3115A2, a precision pressure sensor with altimetry, both from NXP Semiconductor. Those two sensors are high-performance, low-power devices covering all of Earth's surface elevations. By combining the acceleration and the barometric pressure data, you can easily determine the vertical velocity (the rate of climb) of the device on which the Accel&Pressure Click is integrated.

[Learn More]