44 lines
932 B
C++
44 lines
932 B
C++
#include "config.h"
|
|
#include "turret.h"
|
|
|
|
Turret turret(PIN_X_DIRECTION, PIN_X_PULSE, PIN_X_ENABLE, PIN_X_HOME,
|
|
PIN_Y_DIRECTION, PIN_Y_PULSE, PIN_Y_ENABLE, PIN_Y_HOME,
|
|
PIN_LASER);
|
|
|
|
void setup() {
|
|
turret.init();
|
|
|
|
Serial.begin(BAUDRATE);
|
|
|
|
turret.laserOn().calibrate().moveTo(0, 0, 0);
|
|
delay(5000);
|
|
|
|
// test pointage
|
|
double panelWidth = 124.7;
|
|
double panelHeight = 145.0;
|
|
int panelHCount = 3;
|
|
int panelVCount = 2;
|
|
|
|
double zeroOffsetV = -21;
|
|
double zeroOffsetH = -163;
|
|
// double zeroOffsetH = -147;
|
|
|
|
// Test constant step h,v
|
|
for (double step = 0; step < 160; step += 10) {
|
|
Serial.print("[step]: ");
|
|
Serial.println(step);
|
|
turret.moveTo(step, 0, 0);
|
|
delay(5000);
|
|
}
|
|
for (double step = 0; step > -160; step -= 10) {
|
|
Serial.print("[step]: ");
|
|
Serial.println(step);
|
|
turret.moveTo(step, 0, 0);
|
|
delay(5000);
|
|
}
|
|
|
|
turret.gotoZero();
|
|
}
|
|
|
|
void loop() {}
|