stepper17  2.0.0.0
Macros | Functions
main.c File Reference

Stepper17 Click example. More...

#include "board.h"
#include "log.h"
#include "stepper17.h"

Macros

#define FULL_CIRCLE   50
 

Functions

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

Detailed Description

Stepper17 Click example.

Description

This is an example application for showing Stepper 17 click ability to control motor. First, it sets default configuration, then runs motor on every turn it stops when makes a full circle and it changes direction on every iteration and on every CW movement changes step resolution.

The demo application is composed of two sections :

Application Init

Initialization of UART(for logging states and errors), I2C and PWM modules and additional GPIO's. Sets default configuration for click board and starts motor rotating in CW direction in 1/32 step resolution.

Application Task

Runs motor one circle, stops and pauses for 2seconds, and runs motor in opposite direction. On every CW run it changes step resolution. It loops from 1/2 step resolution to 1/32 resolution.

Note
Click is tested with motor with 1 step = 1.8degree with PWM configured with 1500Hz. You may need to lower MCU frequency to reach 1500Hz PWM frequency.
Author
Luka Filipovic

Macro Definition Documentation

◆ FULL_CIRCLE

#define FULL_CIRCLE   50

Function Documentation

◆ application_init()

void application_init ( void  )

< Logger config object.

< Click config object.

◆ application_task()

void application_task ( void  )

◆ main()

void main ( void  )