Giter Club home page Giter Club logo

iaccelstepper's Introduction

iAccelStepper

interrupt driven stepper controller inherited from AccelStepper

To use this module inherit from the AccelStepper class, modify it to expose necessary members into public:

  • _stepInterval
  • _direction
  • _currentPos
  • _targetPos
  • _speed
  • _pin[4]

Easiest is to use provided patch https://github.com/sq7bti/iAccelStepper/blob/master/AccelStepper.patch

Within Energia on LM4F target there are only two timers available for free use: Timer1 and Timer2

  • // SYSCTL_PERIPH_TIMER0, // wiring_analog.c analogWrite()
  • SYSCTL_PERIPH_TIMER1,
  • SYSCTL_PERIPH_TIMER2,
  • SYSCTL_PERIPH_TIMER3
  • // SYSCTL_PERIPH_TIMER4, // Tone.c
  • // SYSCTL_PERIPH_TIMER5, // wiring.c - millis() micros()
  • // SYSCTL_PERIPH_TIMER6,
  • // SYSCTL_PERIPH_TIMER7

To sum up, both the original AccelStepper and iAccelStepper library should be located in your library folder, not necessarily in a common folder: ${ENERGIA_PROJECT}/sketches ${ENERGIA_PROJECT}/libraries/AccelStepper/AccelStepper.cpp ${ENERGIA_PROJECT}/libraries/AccelStepper/AccelStepper.h ${ENERGIA_PROJECT}/libraries/iAccelStepper/iAccelStepper.cpp ${ENERGIA_PROJECT}/libraries/iAccelStepper/iAccelStepper.h

In the main ino file one need to include both header files:

#include "AccelStepper.h"
#include "iAccelStepper.h"

Instantiation of object boils down to an empty declaration:

iAccelStepper axis1;
iAccelStepper axis2;

setup() should contain initialisation call:

axis1.begin(PB_0, PB_5);
axis2.begin(PE_4, PB_1);

To perform a movement, the usual methods of the original AccelStepper should be used, such as move(), moveTo() and stop(). The difference is iAccelStepper DO_NOT_REQUIRE call run() method. See example for more.

iaccelstepper's People

Contributors

sq7bti avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

iaccelstepper's Issues

Further help porting this to other boards

Hi - I stumbled across this library while trying to find a solution to move the Accelstepper run() method out of the main polling loop. I believe your adaptation of the Accelstepper library is the exact solution for this, and one many people would benefit from if it could be adapted to other boards (arduino, ARM cortex M).

I saw the other comment on adapting this for arduino, and while I vaguely understand the concept, I do not currently have the technical ability/knowledge to port this to another board.

If possible, can you help with further support for this effort? I am happy to learn more and attempt per your suggestions/advice as I imagine you are busy.

I really think this library could be very, very useful to many other folks with other popular boards like arduino, & ARM. I particularly am interested in adapting this code base to the SAMD21 or SAMD51 ARM cortex M series. Any and all help is appreciated. Thank you and great work here, would love to connect further on this topic if possible.

AccelStepper::begin

There isn't any function like this one... Can you change the main structure of the iAccelStepper, or can you write down the version of the AccelStepper lib for the current iAccelStepper?

error: 'long unsigned int AccelStepper::_stepInterval' is private

hi, happy to find you library.
as its extends the original library it would help to expand about the install procedure.
as i understood:

  • place accelStepper in the library folder of your board
  • place iAccelStepper in that same library (overwriting conflict)
    *. import iAccelStepper.h & AccelStepper.h

what i'm currently getting is

[/opt/energia/hardware/tools/lm4f/bin/arm-none-eabi-g++, -c, -g, -Os, -w, -fno-rtti, -fno-exceptions, -ffunction-sections, -fdata-sections, -mthumb, -mcpu=cortex-m4, -mfloat-abi=hard, -mfpu=fpv4-sp-d16, -fsingle-precision-constant, -DF_CPU=120000000L, -MMD, -DARDUINO=101, -DENERGIA=12, -I/opt/energia/hardware/lm4f/cores/lm4f, -I/opt/energia/hardware/lm4f/variants/launchpad_129, -I/opt/energia/hardware/lm4f/libraries/AccelStepper, /tmp/build8509695019000905233.tmp/sketch_oct30a.cpp, -o, /tmp/build8509695019000905233.tmp/sketch_oct30a.cpp.o]
In file included from sketch_oct30a.ino:1:0:
/opt/energia/hardware/lm4f/libraries/AccelStepper/AccelStepper.h: In member function 'long unsigned int iAccelStepper::stepInterval()':
/opt/energia/hardware/lm4f/libraries/AccelStepper/AccelStepper.h:557:20: error: 'long unsigned int AccelStepper::_stepInterval' is private
In file included from sketch_oct30a.ino:2:0:
/opt/energia/hardware/lm4f/libraries/AccelStepper/iAccelStepper.h:20:41: error: within this context
In file included from sketch_oct30a.ino:1:0:
/opt/energia/hardware/lm4f/libraries/AccelStepper/AccelStepper.h: In member function 'boolean iAccelStepper::difolder of original accelStepperrection()':
/opt/energia/hardware/lm4f/libraries/AccelStepper/AccelStepper.h:596:13: error: 'boolean AccelStepper::_direction' is private
In file included from sketch_oct30a.ino:2:0:
/opt/energia/hardware/lm4f/libraries/AccelStepper/iAccelStepper.h:21:32: error: within this context

Does this work with standard Arduino?

I need to use your library with 8-bit Arduino Uno / ATmega328. I took a quick look at your code, and it looked like this is meant for a different platform. Can you please confirm if this will or will not work with the 8-bit AVR platforms?

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.