1
0
mirror of https://gitlab.com/lander-team/tvc-test-code.git synced 2025-06-16 15:06:56 +00:00

enable servos in prep for verification

This commit is contained in:
Anson Biggs 2021-11-18 12:19:11 -07:00
parent fc987e89cc
commit 8d53c7ea56

View File

@ -14,8 +14,8 @@ float calc_height(float yaw, float pitch);
void setup() {
delay(5000);
// yaw.attach(9); // CHANGE MEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
// pitch.attach(10); // CHANGE MEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
yaw.attach(9); // CHANGE MEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
pitch.attach(10); // CHANGE MEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
Serial.println("Level the TVC and press enter.");
read_float();
@ -26,7 +26,7 @@ void setup() {
double pitch_pos = pct * PITCH_MAX;
yaw.write(yaw_pos);
// pitch.write(pitch_pos);
pitch.write(pitch_pos);
delay(15);
}
@ -38,19 +38,27 @@ void setup() {
void loop() {
Serial.print("Enter Yaw Coord: ");
float yaw_pos = read_float();
if (abs(yaw_pos) > YAW_MAX) {
Serial.println("Value too large, defaulting to maximum deflection");
yaw_pos = YAW_MAX;
}
Serial.println();
Serial.println();
Serial.print("Enter Pitch Coord: ");
float pitch_pos = read_float();
if (abs(pitch_pos) > PITCH_MAX) {
Serial.println("Value too large, defaulting to maximum deflection");
pitch_pos = PITCH_MAX;
}
Serial.println();
Serial.println();
Serial.println("Moving servos to [" + String(yaw_pos) + ", " +
String(pitch_pos) + "]");
// yaw.write(yaw_pos);
// pitch.write(pitch_pos);
yaw.write(yaw_pos);
pitch.write(pitch_pos);
Serial.print("Calculating current height");
for (int i = 0; i < 5; i++) {