How to use a stepper command

Hello everybody,
I'm newbe to Arduino and to this site as well, so please do not hit me too much.
Now I'm trying to use my Arduino Mega 1280 as a steering & control device of one stepper motor. And as I followed basics at Arduino website I found a library (or group of commands) to control a stepper. I'm about to let my stepper make specific amount of steps - this stepper will work as a feeder. After desired number of steps the motor stops and the knife cuts foil. This scheme I would like to put in a loop. The point is I do not know how I can achieve this - just I do not understand how the command for steering stepper should looks like. Can anyone give me some samples so I could rebuild them and use in my project?
BR
mariusz

A lot depends on how you have wired it up and what electronics you have driving the motor, can you tell us more about this.

Have you tried the stepper work, by just having it sit on the table and controlling it from the Arduino - via some driver transistor/MOSFET/Driver-shield? If you do, you should find your question (as I understand it) is worrying too much.

You use the appropiate stepper library, and set up one parameters - what speed it should do (Steps/second; In the stadnard library this is given as two parameters: Number of steps for revolution and how many revolutions per minute) and then you command how many steps it should step. When it has done those steps it stops; all on its own, so to speak, it is not something coded in the library.

So your code should be quite simple: (Just code fragments, not a complete program)

Stepper FeedMotor(200,3,4,5,6) ;
  :
void loop() 
  :
  if (digitalRead(NextPiece)==LOW) {
     FeedMotor.Step(100) ;
     digitalWrite(KnifeCoil,HIGH) ;
     :
     }

Or instead of the "if" you use a "for" , it will then cut N pieces.

Hmm, I wanna use bi-polar stepper but the point is I want to learn on both examples: uni- and bi-polars. In fact I do not want you or someone else to do it instead of me, but to show me and explain everything to let me understand this (or show me where I can find detailed descriptions). I don't know how the code looks like and what each line means. I hope when I see few different codes as an examples with description I will understand it by myself. I hope so.
Sorry for my english - it's not my native language.
m.

The basics of the two types of motors are described here:-
http://www.thebox.myzen.co.uk/Workshop/Motors_3.html
and
http://www.thebox.myzen.co.uk/Workshop/Motors_4.html

A typical example of the stepping drive controlled with a pot is here:-
http://arduino.cc/it/Tutorial/MotorKnob

Thank you very much. I hope this two posts will help me while weekend long.
m.