mirror of
https://gitlab.com/lander-team/lander-cpp.git
synced 2025-08-02 11:31:34 +00:00
intrgrate servos
This commit is contained in:
16
src/main.cpp
16
src/main.cpp
@@ -26,12 +26,8 @@ unsigned long last, initTime;
|
||||
#include <HX711.h>
|
||||
#include <PWMServo.h>
|
||||
|
||||
PWMServo servo1;
|
||||
PWMServo servo2;
|
||||
|
||||
const int pin_servo1 = 33;
|
||||
const int pin_servo2 = 29;
|
||||
const int pin_igniter = 7;
|
||||
PWMServo yaw;
|
||||
PWMServo pitch;
|
||||
|
||||
int servoPos = 90; // variable to store the servo position;
|
||||
|
||||
@@ -48,9 +44,9 @@ void setup() {
|
||||
initLoadCells(State);
|
||||
init_Vehicle(State);
|
||||
|
||||
servo1.attach(pin_servo1);
|
||||
servo2.attach(pin_servo2);
|
||||
testGimbal(servo1, servo2);
|
||||
yaw.attach(29);
|
||||
pitch.attach(33);
|
||||
testGimbal(yaw, pitch);
|
||||
Serial.println("Servos Tested");
|
||||
|
||||
delay(3000);
|
||||
@@ -75,7 +71,7 @@ void loop() {
|
||||
thrustInfo(State);
|
||||
pidController(State, PrevState);
|
||||
TVC(State, PrevState);
|
||||
processTVC(State, servo1, servo2);
|
||||
processTVC(State, yaw, pitch);
|
||||
|
||||
write2CSV(State);
|
||||
|
||||
|
Reference in New Issue
Block a user