How do I use a library function such as:
runSpeed()
boolean AccelStepper::runSpeed | ( | ) |
1) runSpeed() ?
2) bool = runSpeed() ?
3) The library tab also shows it with two colons as above.
Are the colons required syntax when using runSpeed() ?
Can't get the above to format properly. Hope it makes sense.
How do I use a library function such as:
runSpeed()
First you create the object as in ...
AccelStepper myStppr(1,sStep,sDir); // Create the stepper
and then you invoke it by using the method name after specifying the object you wish to operate and then the method name and any parameters required. In this case ...
myStppr.runSpeed();
I had a psychic girlfriend but she left me before we met.
Thank you.
I have the stepper already defined but I have to declare runSpeed() How do I do that?
I suggest that you read the documentation to see what parameters are required for your particular setup.
i am using an A4988 stepper driver and so the constructor I'm using here is specifying that I'm using a driver (which is what the value 1 stands for) and the pin with name sStep is connected to the A4988 drivers "step" pin and the sDir is the name of the pin which is connected to the A4988's "direction" pin.
If you already have the stepper defined (correctly), then you invoke any of its methods by using the name of the stepper object followed by a dot followed by the method name and include any required parameters.
for instance, if you've called your stepper "rover" ...
rover.runSpeed();
rover.setAcceleration(100);
rover.moveTo(1000);
if (rover.distanceToGo()==0) then ... etc ...
I had a psychic girlfriend but she left me before we met.
Many thanks. I read the documentation a few times. Since it was my first attempt to use a library function from scratch I needed help to fully understand it. Thanks very much for your clarification and examples.
OK, one more suggestion. If you click the "Reply" at the bottom of a post, it will start a new post for you and start it off with @ plus the handle of the person who wrote the text. That will cause an email to be sent to that person telling them that somebody has responded to that post.
If you just start a new post to reply (as you're doing), then the person you're trying to address is not informed of your reply and so won't know that you answered them until they next randomly check for new postings (and maybe not then if they're not concentrating on the thread).
I had a psychic girlfriend but she left me before we met.