I apologize that I am a beginner at this and this seems to be overwhelming me. I have a Stepperonline motor and driver combo I purchased to retrofit on a machine and am controlling it with an Arduino Uno. I want to make the motor push button start and spin until my other button tells it to stop. I have everything working the way I want using the Pinwheel example program, except the motor runs very slow. I need to tell it to run faster. If I use the One Rotation example I can change the parameters to make the motor run faster or slower, but there's no control over start and stop (button control) in that program. I've tried to add a button command to the One Rotation program but I'm just not doing something correctly. Once again, I apologize that I'm a complete beginner but any help would be greatly appreciated on how to go about this.
You need to post your program.
Links to the datasheets for your motor and driver would also be useful.
How fast is the motor rotating?
How fast do you want it to rotate?
...R
created 13 Sep 2012
by Scott Fitzgerald
http://www.arduino.cc/starterKit
This example code is part of the public domain.
*/
// named constants for the switch and motor pins
const int switchPin = 2; // the number of the switch pin
const int motorPin = 9; // the number of the motor pin
int switchState = 0; // variable for reading the switch's status
void setup() {
// initialize the motor pin as an output:
pinMode(motorPin, OUTPUT);
// initialize the switch pin as an input:
pinMode(switchPin, INPUT);
}
void loop() {
// read the state of the switch value:
switchState = digitalRead(switchPin);
// check if the switch is pressed.
if (switchState == HIGH) {
// turn motor on:
digitalWrite(motorPin, HIGH);
} else {
// turn motor off:
digitalWrite(motorPin, LOW);
}
}
Hi Scott,
welcome to the forum ! The users here will support you to get your machine running.
Not nesecessay to apologise beeing a beginner. Each of us was a beginner.
So some questions to get a more detailed picture of your machine:
Do you use switches that hold their position (beeing switched ON / beeing switched OFF)
or
do you uses momentare-buttons which have their contact only closed as long as you press the button.
Both switches and buttons can be used. It is just a difference in programming.
The code you have posted does just switch on/off a single IO-pin.
A stepepr-motor needs a different kind of signal to drive the stepper-motor.
Stay relaxed there are pre-programmed programs for this that are quite easy to use.
Nontheless you need to learn some basics about programming. Are you willing to learn?
best regards Stefan
Try the examples in this Simple Stepper Code
...R
Stepper Motor Basics
This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.