Ke Ao Teensy Flight Software
The software on the Teensy in the Ke Ao cubesat.
|
The satellite's Global Positioning System (GPS). More...
#include <artemis_devices.h>
Classes | |
struct | gpsbeacon |
The GPS beacon structure. More... | |
Public Member Functions | |
int32_t | setup (void) |
Sets up serial connection to GPS sensor. | |
int32_t | update (void) |
Called to update the GPS. | |
int32_t | read (uint32_t uptime) |
Reads GPS sensor and generates a packet on both RFM23 and Astrodev queues. | |
Public Attributes | |
Adafruit_GPS * | gps = new Adafruit_GPS(&Serial7) |
The satellite's Global Positioning System (GPS).
An instance of the Adafruit GPS object.
int32_t Artemis::Devices::GPS::read | ( | uint32_t | uptime | ) |
Reads GPS sensor and generates a packet on both RFM23 and Astrodev queues.
uptime | The time, in milliseconds, that the Teensy has been powered on. |
The GPS data is only transmitted if it has been set up.
A packet and GPS beacon are created. The beacon is given an identification value.
Each temperature sensor is iterated over. It is read via its analog pin, with that raw voltage reading converted to Celcius. It is then stored in the temperature beacon's array.
The packet's header information is filled out, identifying the originator node, destination node, and packet type. The beacon is then copied into the payload of the packet. The packet is then copied into the RFM23 and Astrodev queues for transmission.
int32_t Artemis::Devices::GPS::setup | ( | void | ) |
Sets up serial connection to GPS sensor.
The serial connection to the GPS module is initialized.
The output format of the GPS is set. Possible options are:
The update rate of the GPS is set. Possible options are:
Note that this sets the rate at which the GPS module reports its data to the Teensy. This does NOT change the rate at which the GPS module updates its position fix.
To change that value, use the position fix update rate commands. Possible options are:
The GPS module is limited to a 5 Hz position fix update rate, but can report at 10 Hz.
int32_t Artemis::Devices::GPS::update | ( | void | ) |
Called to update the GPS.
The GPS is only checked if it has been set up.
The GPS is checked to see if there are any bytes available to be read. If there are, all the bytes are read in.
If the read in bytes form a new and complete NMEA sentence, parse that NMEA sentence and store the values in the object.