most functionality to splashdwon, find neutral and start mission. short timeouts still in code for testing, will adjust to go directly to sit_idle after splashdown

Dependencies:   mbed MODSERIAL FATFileSystem

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Sensors.cpp Source File

Sensors.cpp

00001 #include "Sensors.hpp"
00002 #include "StaticDefs.hpp"
00003 
00004 Sensors::Sensors() {
00005     _reference_voltage = 5.0;   //check this against actual v_ref
00006 }  
00007   
00008     // extrapolated from graph if V_s = 5.0
00009     // https://www.nxp.com/docs/en/data-sheet/MPXA6115A.pdf   
00010 float Sensors::getInternalPressurePSI() {
00011     return ( ( 22.029 * ( _reference_voltage * adc().readCh5() / 4095.0 ) + 10.884 ) * 0.145038 ); // Press_Xducer (on-board)
00012 }
00013 
00014 float Sensors::getVoltageInput() {
00015     return ( adc().readCh6() / 4095.0 * _reference_voltage * 7.8 );
00016 }
00017 
00018 float Sensors::getCurrentInput() {
00019     return ( adc().readCh7() / 4095.0 * _reference_voltage );
00020 }
00021 
00022 //currently using BCE CS line for this data
00023 float Sensors::getAltimeterChannelReadings() {
00024     return adc().readCh2();             //channel 2 (third channel) from the schematic
00025 }