Motors Library: Counting # of steps

I'm making my stepper motor rotate using the Arduino Motor Shield. It's continuously rotating back + forth from -55 steps to +55 steps in a forever while loop. I want to count the number of rotations or number of cycles. How do I do that? Is there a special function that counts cycles or steps of a motor? So far, I need code that will do the following below; below is my pseudo-code.

switch-case (my text input):
'1': start counting motor cycles, turn on motor
'0': stop counting, turn off motor

count cycle function: input (my text input of '1')
if total_steps == 55.5: counter++ // 1 cycle is completed
if total steps == -55.5: counter++ // 1 cycle is completed

Is there a function that can give the value for total # of steps rotated?

not sure how your program looks like
if one cycle takes 55 steps and you have a loop for it somewhere after each loop increase a counter cycle

if it is based on the loop with an ever increasing counter
then there is the modulo function ---> %

if( counter % 55==0){cycle++;}

I'm making my stepper motor rotate using the Arduino Motor Shield. It's continuously rotating back + forth from -55 steps to +55 steps in a forever while loop.

And the code looks like?

I want to count the number of rotations or number of cycles.

Counting the number of steps depends on how you make the stepper step. Counting the number of cycles depends on what you mean by a cycle.

Is there a special function that counts cycles or steps of a motor?

No. There is nothing special about it.

So far, I need code that will do the following below; below is my pseudo-code.

So, you want pseudo answers. Got it.

I got another question. Now, my stepper motor's gonna spin really fast, at many cycles back and forth, even up to 10,000+ cycles, maybe up to a million cycles in the duration of a day. The motor will run continuously all day. I have the counter to count the number of cycles (cycle= 1 motion of back+forth). The cycle must always be a whole number. I've called the cycle counter to be an "int", but instead of '"int", there are other variables that can store more bits or numbers, even up to a million. Will "int total_cycle_count" be adequate or should I change that to "float total_cycle_count"?

I think I can answer my own question. Unsigned long can store variables up to 4 million bits: http://arduino.cc/en/Reference/UnsignedLong

"Unsigned long variables are extended size variables for number storage, and store 32 bits (4 bytes). Unlike standard longs unsigned longs won't store negative numbers, making their range from 0 to 4,294,967,295 (2^32 - 1). "

Unsigned long can store variables up to 4 million bits

No, that would be a unsigned colossal, and would not work on an Arduino.

An unsigned long is 32 bits, and can store values up to 4 million plus. Not 4 millions bits.

An unsigned long is 32 bits, and can store values up to 4 million plus.

Plus an awful lot, about four billion two hundred and ninety million plus.

32 bits means that numbers from 0 to 2^32 (that's 4, 294, 967, 296!) can be stored.

that numbers from 0 to 2^32

Very, very close.
0 to 4 294 967 295

Oh, right, it's supposed to be from 0 to (2^32)-1.

great to see people ask question, not that clear find "other" solutions, raise new questions and next solve them.

Perhaps enlighten us a little bit, what are you making ?, we wont need to see your code just out of curiosity

you use this more as a learning blog for yourself.
For questions be a bit more specific for people willing to help what you ask them.
i dont say its wrong or so but.. hm but i'm wondering how to respond to such type of blogging on the forum, as you didnt seem to need help.

but i'm wondering how to respond to such type of blogging on the forum,

In my opinion, you treat it just the same as if a bunch of friends were chatting in your living room. If it bothers you, move on. If not, join in.

The forum is archived, so the blogging here persists, and may help someone else in the future.