From 9c5e25cf900a18fd78582aa82479a2aa6992136e Mon Sep 17 00:00:00 2001 From: Mathis et Yohan Date: Sat, 20 Nov 2021 22:15:50 +0100 Subject: [PATCH] Update Code --- RLS_V1.0/.DS_Store | Bin 12292 -> 12292 bytes .../R2Home_OBC_V1.01/R2Home_OBC_V1.01.ino | 26 ++++++++++-------- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/RLS_V1.0/.DS_Store b/RLS_V1.0/.DS_Store index a56568c96ea3039969dabf7c1a8da4d4938357c2..225a78b2a75f6af5d526df04b951a6eae86ade0c 100644 GIT binary patch delta 79 zcmZokXi3<>EXsIga=(b)W+TxptgKstD;O9++{u#C+z8(0aOwLjjEs{Ps3~oZRG7~O UWD2k-ZEXtTRxnD$Yvytc)R@MzuR2UdQ+{u#C+z8(0aOwLjljo}`Z;n)$&&J3w TS%5`(vyA#3b_jE_jQR@zq^cJL diff --git a/RLS_V1.0/R2Home_SOFTWARE_V1.01/R2Home_OBC_V1.01/R2Home_OBC_V1.01.ino b/RLS_V1.0/R2Home_SOFTWARE_V1.01/R2Home_OBC_V1.01/R2Home_OBC_V1.01.ino index 0664373..b9328ea 100644 --- a/RLS_V1.0/R2Home_SOFTWARE_V1.01/R2Home_OBC_V1.01/R2Home_OBC_V1.01.ino +++ b/RLS_V1.0/R2Home_SOFTWARE_V1.01/R2Home_OBC_V1.01/R2Home_OBC_V1.01.ino @@ -12,12 +12,14 @@ // ----------------------------------- SETUP PANEL ----------------------------------- // #define i_want_to_fly false -#define autopilot_mode 1 +#define autopilot_mode 1 #define drop true #define record_home false #define dep_alt 100 -#define vup 3 -#define vdown 4 +#define vup 1.5 +#define vdown 2 + +#define gps_port Serial7 #define bcritical 3.7 #define blow 3.8 @@ -1170,29 +1172,29 @@ void dateTime(uint16_t* date, uint16_t* time){ void gpset(int a, int b, int c, int d, int e){ if (a == 9600) { - Serial7.begin(9600); + gps_port.begin(9600); delay(100); byte packet1[] = {0xB5, 0x62, 0x06, 0x00, 0x14, 0x00, 0x01, 0x00, 0x00, 0x00, 0xC0, 0x08, 0x00, 0x00, 0x80, 0x25, 0x00, 0x00, 0x07, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x92, 0xB5}; sendPacket(packet1, sizeof(packet1)); } if (a == 57600) { - Serial7.begin(9600); + gps_port.begin(9600); delay(100); byte packet2[] = {0xB5, 0x62, 0x06, 0x00, 0x14, 0x00, 0x01, 0x00, 0x00, 0x00, 0xC0, 0x08, 0x00, 0x00, 0x00, 0xE1, 0x00, 0x00, 0x07, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xCE, 0xC9}; sendPacket(packet2, sizeof(packet2)); - Serial7.end(); - Serial7.begin(57600); + gps_port.end(); + gps_port.begin(57600); delay(100); } if (a == 115200) { - Serial7.begin(9600); + gps_port.begin(9600); delay(100); byte packet3[] = {0xB5, 0x62, 0x06, 0x00, 0x14, 0x00, 0x01, 0x00, 0x00, 0x00, 0xC0, 0x08, 0x00, 0x00, 0x00, 0xC2, 0x01, 0x00, 0x07, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xB0, 0x7E}; sendPacket(packet3, sizeof(packet3)); - Serial7.end(); - Serial7.begin(115200); + gps_port.end(); + gps_port.begin(115200); delay(100); } @@ -1243,12 +1245,12 @@ if (e == 1) { sendPacket(packet11, sizeof(packet11)); } - Serial7.addMemoryForRead(serial2bufferRead, sizeof(serial2bufferRead)); + gps_port.addMemoryForRead(serial2bufferRead, sizeof(serial2bufferRead)); } void sendPacket(byte *packet, byte len){ - for (byte i = 0; i < len; i++) { Serial7.write(packet[i]); } + for (byte i = 0; i < len; i++) { gps_port.write(packet[i]); } } void newfile() {