Giter VIP home page Giter VIP logo

stepmotor's Introduction

Banner

StepMotor Library

Using Step Motor in AVR - ARM Cortex M

Download Driver Version : StepperDriver

Version : 0.1.0

  • Type : Embedded Software.

  • Support : AVR/ARM STM32 series.

  • Program Language : C

  • Properties :

Initialization and de-initialization functions:

Operation functions:

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 */

Macros:

#define _MOTOR_PORT  
#define _MOTOR_PIN_A  

#define _FULL_ANGLE  
#define _STEP_QUANTITY  

#define _STM32_HAL_DRIVER  

How to use this library

The Stepper Motor library can be used as follows:

1. Add .h and source file in project.

2. Config GPIO as output in your project.

3. Config Stepper Motor in 'STEP_MOTOR_CONFIG.h' header, for example:

  • 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"
    

4. Using operation methods, for example:

Example 1:

int main(void)
{
	
    while (1) 
    {
  
      StepMotor_WaveDriveChangeStep(10, 250);
      _DELAY_MS(500);
    
      StepMotor_WaveDriveChangeStep(-12, 250);
      _DELAY_MS(500);
    
    }
}
   

Example 2:

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);
    
    }
}
   

Tests performed:

  • Run on AVR
  • Run on STM32 Fx cores

Developer: Majid Derhambakhsh

stepmotor's People

Contributors

majid-derhambakhsh avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.