stepper18 2.0.0.0
main.c File Reference

Stepper18 Click example. More...

#include "board.h"
#include "log.h"
#include "stepper18.h"

Functions

void application_init (void)
 
void application_task (void)
 
int main (void)
 

Detailed Description

Stepper18 Click example.

Description

This example showcases the device's ability to control the motor. It initializes the device for control and moves the motor in two directions in a variety of speeds for 360 degrees.

The demo application is composed of two sections :

Application Init

Initializes UART and I2C communication modules, and additional
pins for motor control, and set's default configuration

Application Task

First it move motor clockwise for 360 degrees in medium speed. Then changes direction and moves motor for 180 degrees in slow speed, and additional 180 degrees in fast speed.

Note
Step resolution is changed by the switches[ M0, M1 ] on device. Full step : M0=>0 , M1=>0 Half step : M0=>1 , M1=>0 Quarter step : M0=>0 , M1=>1 1/8 step : M0=>1 , M1=>1 1/16 step : M0=>Hi-Z , M1=>1 1/32 step : M0=>0 , M1=>Hi-Z 1/64 step : M0=>Hi-Z , M1=>0 1/128 step : M0=>Hi-Z , M1=>Hi-Z 1/256 step : M0=>1 , M1=>0
Author
Luka Filipovic

Function Documentation

◆ application_init()

void application_init ( void )

< Logger config object.

< Click config object.

Logger initialization. Default baud rate: 115200 Default log level: LOG_LEVEL_DEBUG

Note
If USB_UART_RX and USB_UART_TX are defined as HAL_PIN_NC, you will need to define them manually for log to work. See LOG_MAP_USB_UART macro definition for detailed explanation.

◆ application_task()

void application_task ( void )

◆ main()

int main ( void )