mirror of
https://gitlab.com/lander-team/tvc-test-code.git
synced 2025-06-16 23:16:51 +00:00
started outlining test
This commit is contained in:
parent
df0f021473
commit
4fee260ed2
39
src/main.cpp
39
src/main.cpp
@ -4,20 +4,33 @@
|
|||||||
Servo yaw;
|
Servo yaw;
|
||||||
Servo pitch;
|
Servo pitch;
|
||||||
|
|
||||||
|
double YAW_MAX = 7;
|
||||||
|
double PITCH_MAX = 7;
|
||||||
|
|
||||||
|
double zero_height;
|
||||||
|
|
||||||
|
double point_height(double TVC_angle) { return sin(TVC_angle) + zero_height; }
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
yaw.attach(9); // CHANGE MEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
|
yaw.attach(9); // CHANGE MEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
|
||||||
pitch.attach(10); // CHANGE MEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
|
pitch.attach(10); // CHANGE MEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
|
||||||
|
|
||||||
|
Serial.println("Level the TVC and press enter.");
|
||||||
|
Serial.readString();
|
||||||
|
|
||||||
|
// Do a full range of movement of the servos
|
||||||
|
for (double pct = -100.0; pct <= 100.0; pct += 1.0) {
|
||||||
|
double yaw_pos = pct * YAW_MAX;
|
||||||
|
double pitch_pos = pct * PITCH_MAX;
|
||||||
|
|
||||||
|
yaw.write(yaw_pos);
|
||||||
|
pitch.write(pitch_pos);
|
||||||
|
delay(15);
|
||||||
|
}
|
||||||
|
|
||||||
|
Serial.print("Please input the point height in millimeters: ");
|
||||||
|
String zero_string = Serial.readString();
|
||||||
|
zero_height = zero_string.toFloat();
|
||||||
}
|
}
|
||||||
|
|
||||||
void loop() {
|
void loop() {}
|
||||||
for (int pos = 0; pos <= 180; pos += 1) {
|
|
||||||
yaw.write(pos);
|
|
||||||
pitch.write(pos);
|
|
||||||
delay(15);
|
|
||||||
}
|
|
||||||
for (int pos = 180; pos >= 0; pos -= 1) {
|
|
||||||
yaw.write(pos);
|
|
||||||
pitch.write(pos);
|
|
||||||
delay(15);
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user