stepper16 2.0.0.0
main.c File Reference

Stepper16 Click example. More...

#include "board.h"
#include "log.h"
#include "stepper16.h"

Functions

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

Detailed Description

Stepper16 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 and step resolutions for 360 degrees.

The demo application is composed of two sections :

Application Init

Initializes UART and SPI communication modules, and additional
pins for motor control, resets device, set's default configuration, and reads its ID and sets

Application Task

First it move motor clockwise for 360 degrees in medium speed and full step resolution. Then changes direction and moves motor for 180 degrees in slow speed and quarter step, and additional 180 degrees in fast speed and 1/16 step resolution.

Note
Device is powered by externam VM so for communication to work Click board should be connected on power supply from 6V to 29V. At the start of application user should reset device and read it's Status register 1 to clear it. After that it can communicate with device and control it noramaly.
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 )