diff --git a/platformio.ini b/platformio.ini deleted file mode 100644 index 1c4796c..0000000 --- a/platformio.ini +++ /dev/null @@ -1,21 +0,0 @@ -; PlatformIO Project Configuration File -; -; Build options: build flags, source filter -; Upload options: custom upload port, speed and extra flags -; Library options: dependencies, extra library storages -; Advanced options: extra scripting -; -; Please visit documentation for the other options and examples -; https://docs.platformio.org/page/projectconf.html - -[env:nucleo_f429zi] -platform = ststm32 -board = nucleo_f429zi -build_flags = -DTEST -framework = arduino - -[env:teensy35] -platform = teensy -board = teensy35 -build_flags = -DTEENSY3 -DTEST -framework = arduino diff --git a/src/main.cpp b/src/main.cpp deleted file mode 100644 index 59c8a65..0000000 --- a/src/main.cpp +++ /dev/null @@ -1,68 +0,0 @@ - -#ifdef TEST -#include -#include -#include "TeensyStep.h" - -using std::vector; - -#define ENABLE_PIN 8 - -Stepper stepper_x(2, 5); // STEP pin: 2, DIR pin: 3 -Stepper stepper_y(3, 6); -StepControl controller; // Use default settings - - -class CPoint{ - public: - CPoint(int x, int y): x(x), y(y) {} - int x = 0; - int y = 0; -}; - -vector points; - -void setup(){ - Serial.begin(115200); - pinMode(LED_BUILTIN, OUTPUT); - pinMode(ENABLE_PIN, OUTPUT); - digitalWrite(LED_BUILTIN, LOW); - digitalWrite(ENABLE_PIN, LOW); - - points.push_back(new CPoint(100, 100)); - points.push_back(new CPoint(200, 200)); - points.push_back(new CPoint(300, 300)); - points.push_back(new CPoint(400, 400)); - points.push_back(new CPoint(500, 500)); - points.push_back(new CPoint(600, 600)); - points.push_back(new CPoint(700, 700)); - points.push_back(new CPoint(800, 800)); - points.push_back(new CPoint(900, 900)); - points.push_back(new CPoint(1000, 1000)); - - #ifdef TEENSY3 - Serial.println("TEENSY3"); - #else - Serial.println("STM32F4"); - #endif -} - -void loop(){ - delay(500); - digitalWrite(LED_BUILTIN, HIGH); - Serial.println("Starting new sequence"); - - for(auto& point : points){ - Serial.printf("Moving to x: %d, y: %d\r\n", point->x, point->y); - stepper_x.setTargetAbs(point->x); - stepper_y.setTargetAbs(point->y); - controller.moveAsync(stepper_x, stepper_y); - while(controller.isRunning()); - } - - //controller.step_calls = controller.pulse_calls = controller.acc_calls = 0; - //Serial.printf("steps: %u, pulses: %u, acc: %u\r\n", controller.step_calls, controller.pulse_calls, controller.acc_calls); - digitalWrite(LED_BUILTIN, LOW); -} - -#endif