Ke Ao Teensy Flight Software
The software on the Teensy in the Ke Ao cubesat.
Loading...
Searching...
No Matches
Artemis::Devices::TemperatureSensors Class Reference

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.
 

Detailed Description

The temperature sensors on the satellite.

Member Function Documentation

◆ read()

int32_t Artemis::Devices::TemperatureSensors::read ( uint32_t  uptime)

Reads temperature sensors and generates a packet on both RFM23 and Astrodev queues.

Parameters
uptimeThe time, in milliseconds, that the Teensy has been powered on.
Returns
int32_t Returns 0 if successful, -1 if temperature sensors have not been set up first.

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.

◆ setup()

int32_t Artemis::Devices::TemperatureSensors::setup ( void  )

Sets up analog connection to temperature sensors.

Returns
int32_t Always returns 0.

Member Data Documentation

◆ temp_sensors

std::map<std::string, int> Artemis::Devices::TemperatureSensors::temp_sensors
Initial value:
= {
{ "obc", A0},
{ "pdu", A1},
{"battery_board", A6},
{"solar_panel_1", A7},
{"solar_panel_2", A8},
{"solar_panel_3", A9},
{"solar_panel_4", A17},
}

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:

  • "obc" to analog pin 0 (physical pin 14)
  • "pdu" to analog pin 1 (physical pin 15)
  • "battery_board" to analog pin 6 (physical pin 20)
  • "solar_panel_1" to analog pin 7 (physical pin 21)
  • "solar_panel_2" to analog pin 8 (physical pin 22)
  • "solar_panel_3" to analog pin 9 (physical pin 23)
  • "solar_panel_4" to analog pin 17 (physical pin 41)

The documentation for this class was generated from the following files: