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-10-12
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: Brushed
Downloaded: 2463 times
Not followed.
License: MIT license
DC Motor 16 Click is a compact add-on board that contains a high-performance single phase reversible DC motor drive with speed control. This board features the ZXBM5210, a fully-featured DC motor drive solution with an average current capability of up to 700mA from Diodes Incorporated.
Library Description
The library covers all the necessary functions to control DC Motor 16 click board. There are functions for controlling motor speed, direction, starting and stoping.
Key functions:
void dcmotor16_set_direction( uint8_t dir )
- Set motor directionvoid dcmotor16_ctrl_vref( uint16_t value )
- Control motor VRef (speed)void dcmotor16_stop( void )
- Motor stopExamples description
The application is composed of three sections :
void application_task ( )
{
uint16_t cnt;
mikrobus_logWrite( ">> Motor start with direction [FORWARD] <<", _LOG_LINE );
dcmotor16_set_direction( DCMOTOR16_DIR_FORWARD );
for( cnt = 0; cnt <= 0x0100; cnt+= 25 )
{
dcmotor16_ctrl_vref( cnt );
Delay_ms( 250 );
}
Delay_ms( 2000 );
mikrobus_logWrite( ">> Motor stop ", _LOG_LINE );
dcmotor16_stop();
Delay_ms( 1000 );
mikrobus_logWrite( ">> Motor start with direction [BACKWARD] <<", _LOG_LINE );
dcmotor16_set_direction( DCMOTOR16_DIR_BACKWARD );
for( cnt = 0; cnt <= 0x0100; cnt+= 25 )
{
dcmotor16_ctrl_vref( cnt );
Delay_ms( 250 );
}
Delay_ms( 2000 );
mikrobus_logWrite( ">> Motor stop ", _LOG_LINE );
dcmotor16_stop();
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.
eINK click is an adapter Click boardâ„¢, used to interface a compatible eINK display with the host MCU.
[Learn More]Audio Amp 2 click is a highly efficient class D audio amplifier, using the TDA7491, a dual BTL class-D audio amplifier IC, capable of delivering up to 20W to 8Ω load.
[Learn More]3D Hall 7 Click is a very accurate, magnetic field sensing Click board™, used to measure the intensity of the magnetic field across three perpendicular axes.
[Learn More]You have unsaved changes. If you choose to leave all changes will be discarded.
Do you want to subscribe in order to receive notifications regarding "DC Motor 16 click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "DC Motor 16 click" changes.
Do you want to report abuse regarding "DC Motor 16 click".