1
0
mirror of https://gitlab.com/lander-team/tvc-test-code.git synced 2025-08-02 19:41:33 +00:00

hopefully this works on the teensy

This commit is contained in:
2021-11-03 20:29:10 -07:00
parent 4fee260ed2
commit 644fcc0931

View File

@@ -9,8 +9,6 @@ double PITCH_MAX = 7;
double zero_height;
double point_height(double TVC_angle) { return sin(TVC_angle) + zero_height; }
void setup() {
yaw.attach(9); // CHANGE MEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
pitch.attach(10); // CHANGE MEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
@@ -33,4 +31,28 @@ void setup() {
zero_height = zero_string.toFloat();
}
void loop() {}
void loop() {
Serial.print("Enter Yaw Coord: ");
float yaw_pos = Serial.readString().toFloat();
Serial.println();
Serial.print("Enter Pitch Coord: ");
float pitch_pos = Serial.readString().toFloat();
Serial.println();
Serial.println("Moving servos...");
yaw.write(yaw_pos);
pitch.write(pitch_pos);
Serial.print("Calculating current height");
for (int i = 0; i < 5; i++) {
Serial.print(".");
delay(i * 100);
}
Serial.println("");
float height = sin(yaw_pos) + sin(pitch_pos) + zero_height;
Serial.println("Please verify current height is correct: " + String(height) +
"\n\n\n\n\n");
}