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:
@@ -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) {
|
||||
|
Reference in New Issue
Block a user