#include #include "BasicStepperDriver.h" #define SYNC_ON 2 #define X_STEP_PIN 8 #define X_DIR_PIN 7 #define X_ENABLE_PIN 12 #define FC A2 #define POTA A1 #define POTB A3 #define MODE 6 #define MASTER 3 #define FIN_IN A7 #define FIN_OUT 4 #define INI_IN 5 #define INI_OUT A5 int MS[3] = {9, 10, 11}; unsigned long POT_VALUE_A = 0; unsigned long POT_VALUE_B = 0; // Motor steps per revolution. Most steppers are 200 steps or 1.8 degrees/step #define MOTOR_STEPS 200 #define RPM 300 // Since microstepping is set externally, make sure this matches the selected mode // If it doesn't, the motor will move at a different RPM than chosen // 1=full step, 2=half step etc. #define MICROSTEPS 32 //Uncomment line to use enable/disable functionality BasicStepperDriver stepperX(MOTOR_STEPS, X_DIR_PIN, X_STEP_PIN, X_ENABLE_PIN ); #define N 1 uint32_t average(int PIN) { uint32_t value = 0; for(int i=0; i