update c mac steppers to take args and remove windows.h
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
// Leib Ramp Stepper program with millis function adapted for MacOS
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <windows.h>
|
||||
#include <math.h>
|
||||
#include <time.h>
|
||||
|
||||
@@ -52,16 +51,12 @@ const float minSpeed = 1.0;
|
||||
const float maxPermissSpeed = 20.0;
|
||||
const float maxAccel = 10.0;
|
||||
|
||||
int main()
|
||||
int main(int argc, char *argv[1])
|
||||
{
|
||||
unsigned long currentMillis = millis();
|
||||
prevStepTime = 0;
|
||||
long positionToMoveTo;
|
||||
while(true)
|
||||
{
|
||||
printf("Enter position to move to in profile (or 999 to terminate)\n");
|
||||
scanf("%ld", &positionToMoveTo);
|
||||
if (positionToMoveTo==999) break;
|
||||
sscanf(argv[1], "%ld", &positionToMoveTo);
|
||||
printf(" Time (s), Speed (steps/s), Accel (steps/s^2), Posit'n (steps), Step time (ticks)\n");
|
||||
|
||||
goToPosition(positionToMoveTo);
|
||||
@@ -104,7 +99,6 @@ int main()
|
||||
computeNewSpeed();
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <windows.h>
|
||||
#include <math.h>
|
||||
#include <time.h>
|
||||
|
||||
@@ -48,16 +47,12 @@ const float minSpeed = 1.0; // in steps/s
|
||||
const float maxPermissSpeed = 20.0; // in steps/s
|
||||
const float maxAccel = 10.0; // in steps/s^2
|
||||
|
||||
int main()
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
unsigned long currentMillis = millis();
|
||||
prevStepTime = 0;
|
||||
long positionToMoveTo;
|
||||
while(true)
|
||||
{
|
||||
printf("Enter position to move to in profile (or 999 to terminate)\n");
|
||||
scanf("%ld", &positionToMoveTo);
|
||||
if (positionToMoveTo==999) break;
|
||||
sscanf(argv[1], "%ld", &positionToMoveTo);
|
||||
printf(" Time (s), Speed (steps/s), Accel (steps/s^2), Posit'n (steps), Step time (ticks)\n");
|
||||
|
||||
goToPosition(positionToMoveTo);
|
||||
@@ -93,7 +88,6 @@ int main()
|
||||
computeNewSpeed();
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user