Try this again, asked for help yesterday and didn't get any.
I am having a hard time getting my stepper motor to work. All of the examples will not compile. There is a problem with WProgram.h and Wiring.h. I read where these have been updated to Arduino.h. When I try to change the Wprogram.h wiring.h to Arduino.h, it says there is a long signed int trouble. Are there any examples that are up to date for stepper motors that already have the correct libraries?
Thank for your help.
fastmike75:
Try this again, asked for help yesterday and didn't get any.
That was not very long ago. Why start a new Thread?
Provide a link to your first Thread.
More importantly, post your code.
...R
I am trying to use the examples that are on the 1.0.5 IDE for stepper motors. The program "one revolution". There is a problem with WProgram.h, it calls up another library called Wiring.h that gives an error when compiling. I read on the forum that you should exclude Wiring.h from the libraries that it has been replaced by Arudino.h or another program. But it doesn't say where to exclude it. Do I need to go in WProgram.h with a document software (like Microsoft Word) and change or delete the line that says Wiring.h? Do you have to do it on the .cpp file also? Where should I put the WProgram.h file at, in the /Arduino/Libraries/ Stepper/ folder?
I see there is a new IDE available, should I download it and the examples would be corrected (plug and play)? The last time I updated IDE a bunch of my programs wouldn't run and had to change them. Will the same thing happen again?
I know these are all basic questions, and I am sorry, wish I had stumper of a problem for y'all.
I posted a new thread because, I thought I might not have used the proper etiquette in the previous thread, I didn't get an answer.
Thanks for your patience and understanding.
You did not post your code - and we don't have all the example code in our heads. Help us to help you.
Also, you did not post a link to your earlier Thread so that I can see what is in it.
The 1.0.5 IDE should be fine. I normally use 1.5.6. Do NOT upgrade to 1.6.x
...R
Here is the example code from the 1.0.5 IDE for stepper motors.
I am not sure how to send you the compiling errors, it will not copy and paste like the code does.
WProgram.h wants to include Wiring.h and it is not there or is not compatible anymore. So it is getting a bunch of errors, it doesn't have the code it needs to compile.
What is the deal with the link to the previous post. How do I do that and is there a reason why I should?
/*
Stepper Motor Control - one revolution
This program drives a unipolar or bipolar stepper motor.
The motor is attached to digital pins 8 - 11 of the Arduino.
The motor should revolve one revolution in one direction, then
one revolution in the other direction.
Created 11 Mar. 2007
Modified 30 Nov. 2009
by Tom Igoe
*/
#include <Stepper.h>
const int stepsPerRevolution = 200; // change this to fit the number of steps per revolution
// for your motor
// initialize the stepper library on pins 8 through 11:
Stepper myStepper(stepsPerRevolution, 8,9,10,11);
void setup() {
// set the speed at 60 rpm:
myStepper.setSpeed(60);
// initialize the serial port:
Serial.begin(9600);
}
void loop() {
// step one revolution in one direction:
Serial.println("clockwise");
myStepper.step(stepsPerRevolution);
delay(500);
// step one revolution in the other direction:
Serial.println("counterclockwise");
myStepper.step(-stepsPerRevolution);
delay(500);
}
I didn't mean to sound grouchy on the last post. I really want to understand and to help. This is a very valuable place to get help, if the link helps people then I will do it. It is probably using the "insert a link" icon on top of this reply box. Should I link that post to this one? Especially if this one gets solved?
What version of the IDE are you using?
PLEASE post the link to the earlier Thread - why is it necessary to ask more than once?
...R
I put a link from the first post to this one. Hope I did if right. I do not understand the reason why. I rarely come on these forums so I am at a disadvantage on how to do things. I can usually figure the code out on my own, this stepper motor code has been a block wall and I need to get on the other side. Just need a little guidance and help from someone wiser and more experienced. I promise I will learn from my mistakes and get better at trying to communicate with you.
It says right there in the post above IDE 1.0.5., if you go up on the file menu of that version and select the example you want, this Stepper_OneRotation example code was there. That is what I copied to the code post above.
I explained above the WProgram.h file evidently wants use a library file called Wiring.h. Wiring.h is not in the library and from what I can tell and old obsolete driver/library file. So the variables or info WProgram.h is sending or wants from Wiring.h are not defined in that scope and the program will not compile.
I read on another old thread that whatever Wiring.h did, is now in Arduino.h or another file. Says to eliminate the Wiring.h file somehow. Not sure how to do that or whether the code will pickup Arduino.h or another file automatically for whatever it needs.
Like I asked before. Surely there is an up to date better stepper motor driver other than stepper.h. I see several others like Accelstepper and Customstepper are they the up to date ones I should be using?
Greatly appreciate you guys with more wisdom and knowledge about these things. Thanks you for your time and help.
I'd expect that you would find AccelStepper to be the preferred library, and Mike states in his changelog that it is compatible with 1.0.5 of the IDE.
Either an A4988 or DRV8825 would work for your motors. Both come on modules with identical pinouts; the DRV8825 has slightly higher amperage output (2.2A vs 2A). You will need heatsinks and a fan for those modules if you're pushing a full 1.7A through your motors (and remember you don't need to set them to a full 1.7A if less current will meet your needs). Pololu.com has good documentation on both modules.
fastmike75:
I put a link from the first post to this one.
Reminds me of the Irish joke "Ahh, if I was going there I wouldn't start from here"
Since I don't know where your first Thread is how can I find the link to this Thread.
In any case the code you posted in Reply #4 compiles with no trouble on IDE 1.0.6 and 1.5.6 - I don't have 1.0.5 on my PC.
...R
Now I have accidentally bumped into your other Thread
As I expected it has a lot of relevant material.
And, as I suggested in Reply #1 above, IMHO it would have made a lot more sense to have continued the discussion in the original Thread.
I am a great believer in one Project one Thread.
A servo would be a much easier way to control a bulldozer blade - easier to program and easier to install. With a stepper motor you need a stepper driver board and at least one limit switch to detect the "home" or zero position.
...R
Robin2 please stop answering my posts. You ask "why is it necessary to ask more than once" and I am wondering the same thing. My questions have been very straight forward. If you are more interested in how things are posted than answering questions maybe you need a break. Sounds like a major case of burn out. You where once a beginner and I would encourage you to have more patience for what you probably consider stupid questions. This site all about sharing knowledge and helping those who need it.
Let someone else who WANTS to help answer my questions. Not hold me hostage for a link to another post.
After three days, thanks anyway, I will figure it out on my own.
Chagrin, thanks I will look into AccelStepper. Servos are very expensive for one big enough to hold and move the weight of the blade, if they even make them, it is an 18" x 6" piece of 3/16" steel, way out on the end of a lever. It is going to take a pretty heavy duty something to keep that stable. Will keep experimenting. Thanks.
Problem solved!
After trying Stepper, CustomStepper and Accelstepper and none of them would compile, with the same errors. I totally deleted anything Arduino off my computer and reloaded it, the programs compile without any errors. I am not sure what anyone could have done to solve this problem. Thanks for the help.
Here is a link to the original post RC Dozer, Best controller and software
fastmike75:
I totally deleted anything Arduino off my computer and reloaded it, the programs compile without any errors.
Unfortunately that is not unusual and it is VERY frustrating.
...R
I had no idea what the problem was and it was totally frustrating! Like a block wall, nothing I did helped.
Surprised this is a common problem. For what it is worth to help others reading this. I had loaded several versions of the Arduino IDE on my computer. Think I had 0022 and 1.0.5 on there and there must have been some kind of reference messed up somewhere. Saved all of my sketches on backup and uninstalled the IDE's off my computer, cleaned up all of the folders and installed 1.0.6. The first example on stepper compiled without any issues. Thank you Jesus!
I am back up and burning rubber! Thank you so much for your help and a very humble apology to Robin2. I am not a passive, patient, Casper milk toast type person, more like a steam roller with shoes. I can be a grouchy old SOB sometimes, but I get stuff done. Thanks again for the massive amount of patience you guys show for us frustrated hobby programmers.
fastmike75:
a very humble apology to Robin2.
Thank you. No hard feelings this end.
...R