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]
Rating:
Author: MIKROE
Last Updated: 2019-10-25
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: Brushed
Downloaded: 3266 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.
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".
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 :
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:
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.