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-30
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: Haptic
Downloaded: 1820 times
Not followed.
License: MIT license
Vibro Motor 3 Click is a compact add-on board that makes an ideal solution for adding simple haptic feedback in any design.
Do you want to subscribe in order to receive notifications regarding "Vibro Motor 3 click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "Vibro Motor 3 click" changes.
Do you want to report abuse regarding "Vibro Motor 3 click".
Library Description
The library covers all the necessary functions to control Vibro Motor 3 Click board™. Library holds the drivers for writeing and reading, for enable/diasble the device, trigger the device, sets desired mode function, resets all register, for getting status, start or stop the motor, etc.
Key functions:
void vibromotor3_set_mode ( uint8_t mode_sel );
- Function is used to apply the desired mode.void vibromotor3_start_motor ( uint8_t state );
- The function is used to start or stop the motor.void vibromotor3_set_lra_mode ( uint8_t state );
- The function is used to sets the device in LRA mode.Examples description
The application is composed of three sections :
void application_task ( )
{
pwm_duty_cycle += 1000;
mikrobus_logWrite( "Duty cycle applied: ", _LOG_TEXT );
WordToStr( pwm_duty_cycle, log_txt );
Ltrim( log_txt );
mikrobus_logWrite( log_txt, _LOG_LINE );
vibromotor3_pwm_set_duty( pwm_duty_cycle );
if ( pwm_duty_cycle > pwm_max_duty )
{
pwm_duty_cycle = 0;
vibromotor3_pwm_stop( );
Delay_ms( 2000 );
vibromotor3_pwm_start( );
}
Delay_ms( 100 );
}
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.