Stepper 15 click
<PRVIH_PAR_RECENICA_SA_PRODUCT_PAGE_DA_ISPRATE_CELINU>
[click Product page](<CLICK_PRODUCT_PAGE_LINK>)
Click library
- Author : Nenad Filipovic
- Date : Mar 2021.
- Type : I2C/SPI type
Software Support
We provide a library for the Stepper15 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 from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on mikroE github account.
Library Description
This library contains API for Stepper15 Click driver.
Standard key functions :
stepper15_cfg_setup
Config Object Initialization function.
stepper15_init
Initialization function.
stepper15_default_cfg
Click Default Configuration function.
Example key functions :
stepper15_make_one_step
Stepper 15 make one step function.
stepper15_set_direction
Stepper 15 set direction function.
stepper15_step_by_angle
Stepper 15 step by angle function.
Example Description
<EXAMPLE_DESCRIPTION>
The demo application is composed of two sections :
Application Init
This library contains API for the Stepper 15 Click driver. The library contains drivers for work control of the Stepper Motor.
log_cfg_t log_cfg;
LOG_MAP_USB_UART( log_cfg );
log_cfg.level = LOG_LEVEL_DEBUG;
log_cfg.baud = 115200;
log_init( &logger, &log_cfg );
log_info( &logger, " Application Init " );
if ( ( init_flag == I2C_MASTER_ERROR ) || ( init_flag == SPI_MASTER_ERROR ) ) {
log_error( &logger, " Application Init Error. " );
log_info( &logger, " Please, run program again... " );
for ( ; ; );
}
log_info( &logger, " Application Task " );
log_printf( &logger, "---------------------------------\r\n" );
Delay_ms( 100 );
Delay_ms( 100 );
log_printf( &logger, " Fault condition \r\n" );
} else {
log_printf( &logger, " Correct condition \r\n" );
}
log_printf( &logger, "---------------------------------\r\n" );
log_printf( &logger, " Stop the stepper motor \r\n" );
Delay_ms( 1000 );
}
Application Task
Initializes I2C and SPI driver and set default configuration, enable the device and enable outputs mode.
log_printf( &logger, "---------------------------------\r\n" );
log_printf( &logger, " Clockwise motion \r\n" );
log_printf( &logger, " Angle of rotation : 90 degrees \r\n" );
log_printf( &logger, " Step speed : 85 %% \r\n" );
Delay_ms( 2000 );
log_printf( &logger, "---------------------------------\r\n" );
log_printf( &logger, " Counterclockwise motion \r\n" );
log_printf( &logger, " Angle of rotation : 180 degrees \r\n" );
log_printf( &logger, " Step speed : 85 %% \r\n" );
Delay_ms( 2000 );
log_printf( &logger, "---------------------------------\r\n" );
log_printf( &logger, " Clockwise motion \r\n" );
log_printf( &logger, " Angle of rotation : 270 degrees \r\n" );
log_printf( &logger, " Step speed : 90 %% \r\n" );
Delay_ms( 2000 );
log_printf( &logger, "---------------------------------\r\n" );
log_printf( &logger, " Counterclockwise motion \r\n" );
log_printf( &logger, " Angle of rotation : 360 degrees \r\n" );
log_printf( &logger, " Step speed : 100 %% \r\n" );
Delay_ms( 2000 );
log_printf( &logger, "---------------------------------\r\n" );
log_printf( &logger, " Clockwise motion \r\n" );
log_printf( &logger, " Angle of rotation : 360 degrees \r\n" );
log_printf( &logger, " Step speed : 100 %% \r\n" );
Delay_ms( 2000 );
}
The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on mikroE github account.
Other mikroE Libraries used in the example:
- MikroSDK.Board
- MikroSDK.Log
- Click.Stepper15
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. UART terminal is available in all Mikroelektronika compilers.