Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
XYBUS authored Jun 15, 2021
1 parent 47b2957 commit 35a3b3c
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions gps.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// this is the code branch for GPS location tracking to calculate the final recovery distance from the launchpad
//
//ATTENTION Jamiee: GPS traccking, application, main code
//Program function:
// Location
// Distance from Launchpad
// Estimated Altitude (Cedric/Seb)

#include <TinyGPS++.h>
#include <AltSoftSerial.h>

static const int RXPin = 4, TXPin = 3;
static const uint32_t GPSBaud = 9600;

// The TinyGPS++ object
TinyGPSPlus gps;

// The serial connection to the GPS device
AltSoftSerial ss(RXPin, TXPin);

void setup(){
Serial.begin(9600);
ss.begin(GPSBaud);
}

void loop(){
// Achieving values for latitude, longitude and altitude.
while (ss.available() > 0){
gps.encode(ss.read());
if (gps.location.isUpdated()){
Serial.print("Latitude= ");
Serial.println(gps.location.lat(), 6); // Latitude in degrees
Serial.print(" Longitude= ");
Serial.println(gps.location.lng(), 6); // Longitude in degrees
Serial.print("Altitude= ");
Serial.println(gps.altitude.meters()); // Altitude in meters

// NEED LAUMCH PAD COORDS TO CALCULATE DISTANCE TO ROCKET
}
}
}

0 comments on commit 35a3b3c

Please sign in to comment.