Go Down

Topic: Arduino uno R3 stepper motor control (Read 12283 times) previous topic - next topic

neksmerj

Nov 08, 2014, 05:30 am Last Edit: Nov 08, 2014, 07:22 am by neksmerj
Not long ago, Robin2 wrote a terrific article entitled:-

Planning & implementing an Arduino program, see here http://forum.arduino.cc/index.php?topic=261445.0

I would be extremely grateful if a similar tutorial could be written to drive a nema 17 stepper motor utilizing an Arduino uno R3 board,and an Adafruit stepper motor board.

Simple controls such as a 3 position switch for forward, stop and reverse, and a potentiometer to control speed.

What I would like to see is how each line of code is developed with an explanation of what each piece of code means along with the meaning of each character.

Once I have a piece of code, how do I get it into my computer and transfer it to the Arduino?

As you can tell, I know absolutely nothing about Aduino's or programming.

Hoping someone can throw some light on my short comings.

Ken 

JimboZA

Have you looked at ada's own tutorial here?

It looks straightforward: if you haven't looked at it, why not try now and see if it makes sense. Then ask specific questions about things that don't make sense to you.
Johannesburg hams call me: ZS6JMB on Highveld rep 145.7875 (-600 & 88.5 tone)
Dr Perry Cox: "Help me to help you, help me to help you...."
Your answer may already be here: https://forum.arduino.cc/index.php?topic=384198.0

neksmerj

Thanks Kimbo,

Yes I have looked at the tutorial, but it doesn't describe what each program step does, nor how to get the program into my computer then into the Arduino.

Many thanks anyway.

Ken

JimboZA

That's Jimbo with a "J"....  8)

Getting it into your Arduino's a matter of ctrl-c copying off the screen and ctrl-v pasting into the IDE, then upload.

Seems like you've not yet worked through the examples in the ide, which are also available here. I'm pretty sure that if you worked through some of those, the ada code would make a fair amount of sense and the forum will help with the missing bits.

You would then most likely be able to answer your own questions about switches for direction and a pot for speed.
Johannesburg hams call me: ZS6JMB on Highveld rep 145.7875 (-600 & 88.5 tone)
Dr Perry Cox: "Help me to help you, help me to help you...."
Your answer may already be here: https://forum.arduino.cc/index.php?topic=384198.0

neksmerj

Jimbo, sorry for misspelling your name.

You are talking to an absolute, total, novice. Reading other sketches means nothing to me. I need an example sketch to control a stepper motor with a line by line description of what each line/character means. I won't know what I'm doing otherwise.

Ken

JimboZA

Yep I get the novice bit, but I think the best way to become a not-a-novice, is to work through the examples that I linked to and which are in the ide in File > Examples.

Then, when you try to understand other code you'll have a fighting chance of figuring it out for yourself. Granted, right now a stepper sketch might make no sense, but it will make sense when you get your mind round some basic concepts.

Don't get me wrong: not refusing to assist, it's just that forum experience is that it's better to go it alone first, then ask for help on specifics. And going it alone, implies working through at least some of those examples.
Johannesburg hams call me: ZS6JMB on Highveld rep 145.7875 (-600 & 88.5 tone)
Dr Perry Cox: "Help me to help you, help me to help you...."
Your answer may already be here: https://forum.arduino.cc/index.php?topic=384198.0

Robin2

I am being polite when I say I am confused.

You sent me a PM earlier today with a link to your other Thread - to which I replied that I was waiting for your response to advice I had given on 1 Nov - the same day you started the other Thread.

Now I find you have started a new Thread (quite unnecessarily) asking for advice which I had already given in the other Thread. I still don't know if you read it.


OK - that advice may not cover all of your present question but it covers at least 50% of it - and the rest (detecting buttons) is well covered in my article and in the sticky several things at a time

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

neksmerj

Hi Robin2

It seems we have crossed paths. The only response I thought I had from you was that you don't respond to PM's, and you suggested that I start a new thread, so that's what I did.

I am new to this forum and am still feeling my way around.

Ken

Robin2

I am new to this forum and am still feeling my way around.
Precisely because you are new to the Forum I would assume you are doing a lot of reading - especially in Threads that you have started yourself.

You may be interested in the code in this new Thread

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

neksmerj

Hi Robin2, you are correct, I am reading as much as time allows.

Can you recommend some books that will give me an insight into the Ardinuo world.

Thanks for your assistance.

Ken

Robin2

Hi Robin2, you are correct, I am reading as much as time allows.

Can you recommend some books that will give me an insight into the Ardinuo world.
I haven't got the impression you are reading the stuff I have taken the time to write !

Sorry, I don't have any book recommendations as I have got all my info from the web. There are plenty of Arduino books but I have not read any of them. In a bookshop recently I did glance through one large book about Arduino Robots and the code was very poorly structured - i.e. it seemed to have no structure.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

neksmerj

Hi Robin2

I admire your knowledge, and of the few of your threads I have read so far, have learned from you.

I am a little disappointed you are having a go at me, you probably have many hundreds of threads, and obviously, I've not read them all.

Ken

Robin2

and obviously, I've not read them all.
I was only referring to the replies I have written specially for you.

Perhaps you did read them as I wrote them but as you have never commented on them I have no way of knowing.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

neksmerj

#13
Nov 10, 2014, 12:18 pm Last Edit: Nov 10, 2014, 12:19 pm by neksmerj
Robin2, fair enough.

I am progressing a little further with my camera slider project. Two weeks ago I had never heard of Arduino or Adafruit products.

I came across an Arduino tutorial called MotorKnob describing how to control the stepper motor speed using a potentiometer.

http://arduino.cc/en/Tutorial/MotorKnob

This I will use. All I need to find out now is where to wire in a 3 position switch for forward, stop and reverse,
and some lines of code.

Just out of curiosity, does it make any difference which order the lines of code are in?

Lots more reading to do.

Ken


Robin2

#14
Nov 10, 2014, 05:04 pm Last Edit: Nov 10, 2014, 05:08 pm by Robin2
Just out of curiosity, does it make any difference which order the lines of code are in?
The order of the code is one of the most important things.

Computers are stupid. They do things that you tell them in the order you tell them - even if what you tell them is wrong.


Quote
Two weeks ago I had never heard of Arduino
If the stuff I have written is too complex for your current level of knowledge you need to tell me and I will be happy to try to explain. But don't just ignore it. 

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

Go Up