How to set stepper motor speed (RPM) without using the stepper library?

I know that you can set the speed using the library "stepper.setSpeed(10);" but is there a way to set the RPM without using that?

why dont you want to use it?

Senso:
why dont you want to use it?

Assignment rules. Just wondering if it's possible or not.

Learn how to use timers... and you're good to go.

But if this is for an assignment, can you even use Arduino libraries?

bubulindo:
Learn how to use timers... and you're good to go.

But if this is for an assignment, can you even use Arduino libraries?

:confused:

I guess the teacher just wants us to control the stepper via the pins directly first then move onto using NPN transistors + the library after. But I'm just stumped if there is a way to set the RPM without the library or if we can use it to set the RPM speed.

its just a delay between each step, so even delay() will work.

guess the teacher just wants us to control the stepper via the pins directly first then move onto using NPN transistors

If you don't use a transistor on the output pins, you will destroy at least part of your arduino. Even if the motor is tiny and only takes a few milliamps, you're still running a risk.

Also, it's possible to do anything without "the library" because you can theoretically recreate the library in your code if you needed to.

Okay. I guess I just can't use the "stepper.step(96);" so I have to use digitalWrite(pin, HIGH) for each of the four wires from the stepper.

Thanks.

Do you know how a stepper motor works?

It's not rocket science to implement some code to get it moving. if you see the order of coil excitation, put that in an array, use it as a circular buffer and you can time the steps with millis (or your timer interrupt). I'm quite sure that some googling of AVR and Stepper motors will give you plenty to start with.

its just a delay between each step, so even delay() will work.

If you want it turn really, really slow, it will. delayMicroseconds() if you want to pick up the pace a bit.