1
0
mirror of https://gitlab.com/lander-team/lander-cpp.git synced 2025-07-23 14:41:25 +00:00

Integrated servos, just neefds to be slowed down now

This commit is contained in:
bpmcgeeney
2021-11-14 13:59:51 -07:00
parent d487d6d30a
commit 8fa9dba55e
2 changed files with 26 additions and 12 deletions

View File

@@ -1,12 +1,13 @@
#include "Vehicle.h"
#include <Arduino.h>
#include <PWMServo.h>
#include <SD.h>
#include <SPI.h>
double loadCellCalibrate();
void initFile();
void thrustInfo(struct Vehicle &);
void processTVC(struct Vehicle &);
void processTVC(struct Vehicle &, class PWMServo &, class PWMServo &);
void write2CSV(struct Vehicle &);
void printSimResults(struct Vehicle &);
void teensyAbort();
@@ -93,7 +94,7 @@ void thrustInfo(Vehicle &State) {
}
}
void processTVC(Vehicle &State) {
void processTVC(Vehicle &State, PWMServo &servo1, PWMServo &servo2) {
if (State.time == 0) {
Serial.println("WARNING: processTVC not implemented for TEENSY");
}
@@ -117,6 +118,9 @@ void processTVC(Vehicle &State) {
State.momentZ = 0.0;
State.F = sqrt(pow(State.Fx, 2) + pow(State.Fy, 2) + pow(State.Fz, 2));
servo1.write(State.xServoDegs);
servo2.write(State.yServoDegs);
}
void write2CSV(Vehicle &State) {