Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 61acba2
Showing
8 changed files
with
1,123 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
This software is Copyright (C) 2008 Mike McCauley. Use is subject to license | ||
conditions. The main licensing options available are GPL V2 or Commercial: | ||
|
||
Open Source Licensing GPL V2 | ||
|
||
This is the appropriate option if you want to share the source code of your | ||
application with everyone you distribute it to, and you also want to give them | ||
the right to share who uses it. If you wish to use this software under Open | ||
Source Licensing, you must contribute all your source code to the open source | ||
community in accordance with the GPL Version 2 when your application is | ||
distributed. See http://www.gnu.org/copyleft/gpl.html | ||
|
||
Commercial Licensing | ||
|
||
This is the appropriate option if you are creating proprietary applications | ||
and you are not prepared to distribute and share the source code of your | ||
application. Contact info@open.com.au for details. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
####################################### | ||
# Syntax Coloring Map For AccelStepper | ||
####################################### | ||
|
||
####################################### | ||
# Datatypes (KEYWORD1) | ||
####################################### | ||
|
||
AccelStepper KEYWORD1 | ||
|
||
####################################### | ||
# Methods and Functions (KEYWORD2) | ||
####################################### | ||
|
||
moveTo KEYWORD2 | ||
move KEYWORD2 | ||
run KEYWORD2 | ||
runSpeed KEYWORD2 | ||
setMaxSpeed KEYWORD2 | ||
setAcceleration KEYWORD2 | ||
setSpeed KEYWORD2 | ||
speed KEYWORD2 | ||
distanceToGo KEYWORD2 | ||
targetPosition KEYWORD2 | ||
currentPosition KEYWORD2 | ||
steCurrentPosition KEYWORD2 | ||
runToPosition KEYWORD2 | ||
runSpeedToPosition KEYWORD2 | ||
runToNewPosition KEYWORD2 | ||
disableOutputs KEYWORD2 | ||
enableOutputs KEYWORD2 | ||
setMinPulseWidth KEYWORD2 | ||
|
||
####################################### | ||
# Constants (LITERAL1) | ||
####################################### | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Copyright (c) 2010 bildr community | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
//This is an example of how you would control 1 stepper | ||
|
||
#include <AccelStepper.h> | ||
|
||
int motorSpeed = 9600; //maximum steps per second (about 3rps / at 16 microsteps) | ||
int motorAccel = 80000; //steps/second/second to accelerate | ||
|
||
int motorDirPin = 2; //digital pin 2 | ||
int motorStepPin = 3; //digital pin 3 | ||
|
||
//set up the accelStepper intance | ||
//the "1" tells it we are using a driver | ||
AccelStepper stepper(1, motorStepPin, motorDirPin); | ||
|
||
|
||
|
||
void setup(){ | ||
stepper.setMaxSpeed(motorSpeed); | ||
stepper.setSpeed(motorSpeed); | ||
stepper.setAcceleration(motorAccel); | ||
|
||
stepper.moveTo(32000); //move 32000 steps (should be 10 rev) | ||
} | ||
|
||
void loop(){ | ||
|
||
//if stepper is at desired location | ||
if (stepper.distanceToGo() == 0){ | ||
//go the other way the same amount of steps | ||
//so if current position is 400 steps out, go position -400 | ||
stepper.moveTo(-stepper.currentPosition()); | ||
} | ||
|
||
|
||
|
||
//these must be called as often as possible to ensure smooth operation | ||
//any delay will cause jerky motion | ||
stepper.run(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
//This is an example of how you would control 2 steppers at the same time | ||
|
||
#include <AccelStepper.h> | ||
|
||
int motorSpeed = 9600; //maximum steps per second (about 3rps / at 16 microsteps) | ||
int motorAccel = 80000; //steps/second/second to accelerate | ||
|
||
int motor1DirPin = 2; //digital pin 2 | ||
int motor1StepPin = 3; //digital pin 3 | ||
|
||
int motor2DirPin = 4; //digital pin 4 | ||
int motor2StepPin = 5; //digital pin 5 | ||
|
||
//set up the accelStepper intances | ||
//the "1" tells it we are using a driver | ||
AccelStepper stepper1(1, motor1StepPin, motor1DirPin); | ||
AccelStepper stepper2(1, motor2StepPin, motor2DirPin); | ||
|
||
|
||
void setup(){ | ||
stepper1.setMaxSpeed(motorSpeed); | ||
stepper2.setMaxSpeed(motorSpeed); | ||
|
||
stepper1.setSpeed(motorSpeed); | ||
stepper2.setSpeed(motorSpeed); | ||
|
||
stepper1.setAcceleration(motorAccel); | ||
stepper2.setAcceleration(motorAccel); | ||
|
||
stepper1.moveTo(32000); //move 32000 steps (should be 10 rev) | ||
stepper2.moveTo(15000); //move 15000 steps | ||
} | ||
|
||
void loop(){ | ||
|
||
//if stepper1 is at desired location | ||
if (stepper1.distanceToGo() == 0){ | ||
//go the other way the same amount of steps | ||
//so if current position is 400 steps out, go position -400 | ||
stepper1.moveTo(-stepper1.currentPosition()); | ||
} | ||
|
||
//if stepper2 is at desired location | ||
if (stepper2.distanceToGo() == 0){ | ||
//go the other way the same amount of steps | ||
//so if current position is 400 steps out, go position -400 | ||
stepper2.moveTo(-stepper2.currentPosition()); | ||
} | ||
|
||
|
||
//these must be called as often as possible to ensure smooth operation | ||
//any delay will cause jerky motion | ||
stepper1.run(); | ||
stepper2.run(); | ||
} |