Hello everyone ^^
We have an unknown stepper motor, and I'm trying to figure out the length of the pulse so we can know the speed (Step/sec)
So we generated this code:
int dirpin = 2;
int steppin = 3;
//________________________________________
void setup()
{
Serial.begin (9600);
pinMode(dirpin, OUTPUT);
pinMode(steppin, OUTPUT);
}
//________________________________________
void loop()
{
digitalWrite(dirpin,LOW);
int i;
for (i = 0; i<8000; i++) // 8000 microsteps
{
digitalWrite(steppin, LOW);
digitalWrite(steppin, HIGH);
delayMicroseconds(100);
}
Serial.println ("******Finish *******") ; // we print finish so we know that the program finished from the for loop
delay(5000); // Stop the stepper motor for 5 sec .
The result is :
1
2
.
.
.
7999
******Finish *******
So the question is what is the time between 1 -> 2 ??
Or is there some other solution to calculate that?
Thank you soo much
greetings