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: 2020-11-02
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: Brushed
Downloaded: 1860 times
Not followed.
License: MIT license
DC Motor 15 Click is a compact add-on board that contains a motor driver with current sense and regulation. This board features the DRV8874, an integrated motor driver with N-channel H-bridge, charge pump, current sensing, and adjustment from Texas Instruments.
Do you want to subscribe in order to receive notifications regarding "DC Motor 15 click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "DC Motor 15 click" changes.
Do you want to report abuse regarding "DC Motor 15 click".
Library Description
The library covers all the necessary functions to control DC Motor 15 Click board™. DC Motor 15 Click communicates with the target board through the RST, CS, PWM and INT pins on mikroBUS™. This library offers functions for setting or clearing of RST, CS and PWM pins, and check the state of the INT pin, also user can use functions that drive motor forward and in reverse or apply brake functions.
Key functions:
void dcmotor15_forward ( );
- Function is used to drive the motor forward.void dcmotor15_reverse ( );
- Function is used to drive the motor in reverse.void dcmotor15_brake ( );
- Function is used to brake the motor.Examples description
The application is composed of three sections :
void application_task ( )
{
mikrobus_logWrite( "The motor turns forward!", _LOG_LINE );
dcmotor15_forward( );
Delay_ms( 5000 );
mikrobus_logWrite( "The motor brakes!", _LOG_LINE );
dcmotor15_brake( );
Delay_ms( 2000 );
mikrobus_logWrite( "The motor turns in reverse!", _LOG_LINE );
dcmotor15_reverse( );
Delay_ms( 5000 );
mikrobus_logWrite( "The motor brakes!", _LOG_LINE );
dcmotor15_brake( );
Delay_ms( 2000 );
}
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.