Ke Ao Teensy Flight Software
The software on the Teensy in the Ke Ao cubesat.
|
The temperature sensors on the satellite. More...
#include <artemis_devices.h>
Classes | |
struct | temperaturebeacon |
The temperature beacon structure. More... | |
Public Member Functions | |
int32_t | setup (void) |
Sets up analog connection to temperature sensors. | |
int32_t | read (uint32_t uptime) |
Reads temperature sensors and generates a packet on both RFM23 and Astrodev queues. | |
Public Attributes | |
std::map< std::string, int > | temp_sensors |
Mapping between temperature sensor string names and their analog pins. | |
The temperature sensors on the satellite.
int32_t Artemis::Devices::TemperatureSensors::read | ( | uint32_t | uptime | ) |
Reads temperature sensors and generates a packet on both RFM23 and Astrodev queues.
uptime | The time, in milliseconds, that the Teensy has been powered on. |
The temperature sensors are only polled if they have been set up.
A packet and temperature 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::TemperatureSensors::setup | ( | void | ) |
Sets up analog connection to temperature sensors.
std::map<std::string, int> Artemis::Devices::TemperatureSensors::temp_sensors |
Mapping between temperature sensor string names and their analog pins.
Each temperature sensor is attached to an analog-capable pin on the Teensy. This mapping ties each of those pins with the name of the sensor it is attached to.
The mapping is as follows: