Giter Site home page Giter Site logo

python-stepper's Introduction

python-stepper

Python Stepper Driver for Raspberry Pi + Easy Driver (or similar stepper motor driver).

Supplies a "Stepper" class with a "step" method that can be used to control a stepper motor's number of steps, speed, direction, and enable status.

Instantiation

To create an instance of a "Stepper," simply supply an array of the motor's step, direction, and enable pins. In the example below, the step pin is "22," the direction pin is "17," and the enable pin is "23."

from Stepper import Stepper
testStepper = Stepper([22, 17, 23])

When the "Stepper" is instantiated, the Raspberry Pi GPIO pins are configured and the stepper "enable" pin is set to high, keeping the stepper in a lower-power mode (i.e. "off").

Using the "Step" Method

The "step" method requires two arguments:

  • Steps (the number of steps the stepper will take)
  • Direction (the direction the stepper will move)

and has two optional arguments:

  • Speed (defines the denominator in the waitTime equation: waitTime = 0.000001/speed. As "speed" is increased, the waitTime between steps is lowered)
  • StayOn (defines whether or not stepper should stay "on" or not. If stepper will need to receive a new step command immediately, this should be set to "True." Otherwise, it should remain at "False.")

Example (3200 steps to the right):

testStepper.step(3200, "right"); #steps, dir, speed, stayOn

python-stepper's People

Contributors

tjmarkham avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

python-stepper's Issues

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.