Using Step Motor in AVR - ARM Cortex M
Download Driver Version : StepperDriver
void StepMotor_WaveDriveChangeStep(int16_t number_of_step , uint16_t step_time); /* This function is for change step in wave drive mode */
void StepMotor_WaveDriveChangeAngle(float angle , uint16_t step_time); /* This function is for change angle in wave drive mode */
#define _MOTOR_PORT
#define _MOTOR_PIN_A
#define _FULL_ANGLE
#define _STEP_QUANTITY
#define _STM32_HAL_DRIVER
-
Options:
/* --- Config Port --- */ #define _MOTOR_PORT &PORTB #define _MOTOR_PIN_A 1 /* --- Config Angle --- */ #define _FULL_ANGLE 360.0f #define _STEP_QUANTITY 200.0f /* --- Config Driver --- */ //#define _STM32_HAL_DRIVER "STM32_GPIO/STM32_GPIO.h"
int main(void)
{
while (1)
{
StepMotor_WaveDriveChangeStep(10, 250);
_DELAY_MS(500);
StepMotor_WaveDriveChangeStep(-12, 250);
_DELAY_MS(500);
}
}
int main(void)
{
while (1)
{
StepMotor_WaveDriveChangeStep(10, 250);
_DELAY_MS(500);
StepMotor_WaveDriveChangeStep(-12, 250);
_DELAY_MS(500);
StepMotor_WaveDriveChangeAngle(101.0, 250);
_DELAY_MS(500);
StepMotor_WaveDriveChangeAngle(-150.6, 250);
_DELAY_MS(500);
}
}
- Run on AVR
- Run on STM32 Fx cores