dcmotor4 2.0.0.0
|
DC MOTOR 4 click is capable of driving motors with a supply voltage from 4.5V to 36V. It carries the MAX14870 motor driver from Maxim Integrated.
We provide a library for the DcMotor4 Click as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Package can be downloaded/installed directly form compilers IDE(recommended way), or downloaded from our LibStock, or found on mikroE github account.
This library contains API for DcMotor4 Click driver.
- Initialization function.void dcmotor4_cfg_setup ( dcmotor4_cfg_t *cfg );
DCMOTOR4_RETVAL dcmotor4_init ( dcmotor4_t *ctx, dcmotor4_cfg_t *cfg );
- Stop PWM module.void dcmotor4_set_duty_cycle ( dcmotor4_t *ctx, pwm_data_t duty_cycle );
void dcmotor4_pwm_stop ( dcmotor4_t *ctx );
void dcmotor4_pwm_start ( dcmotor4_t *ctx );
This library contains API for the DC Motor 4 Click driver. Application change the speed and direction.
The demo application is composed of two sections :
Initialization driver enable's - GPIO, set the direction-control of the motor forward movement, PWM initialization, set PWM duty cycle and PWM frequency, enable the motor, start PWM.
This is an example that demonstrates the use of the DC Motor 4 Click board. DC Motor 4 Click communicates with register via PWM interface. It shows moving in the Clockwise direction from slow to fast speed and from fast to slow speed, then rotating Counter Clockwise, Results are being sent to the Usart Terminal where you can track their changes.
The full application code, and ready to use projects can be installed directly form compilers IDE(recommneded) or found on LibStock page or mikroE GitHub accaunt.
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.