|
| 1 | +/* |
| 2 | +* Brian R Taylor |
| 3 | +* brian.taylor@bolderflight.com |
| 4 | +* |
| 5 | +* Copyright (c) 2021 Bolder Flight Systems Inc |
| 6 | +* |
| 7 | +* Permission is hereby granted, free of charge, to any person obtaining a copy |
| 8 | +* of this software and associated documentation files (the “Software”), to |
| 9 | +* deal in the Software without restriction, including without limitation the |
| 10 | +* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or |
| 11 | +* sell copies of the Software, and to permit persons to whom the Software is |
| 12 | +* furnished to do so, subject to the following conditions: |
| 13 | +* |
| 14 | +* The above copyright notice and this permission notice shall be included in |
| 15 | +* all copies or substantial portions of the Software. |
| 16 | +* |
| 17 | +* THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 18 | +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 19 | +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 20 | +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 21 | +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
| 22 | +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS |
| 23 | +* IN THE SOFTWARE. |
| 24 | +*/ |
| 25 | + |
| 26 | +#include "airdata.h" |
| 27 | + |
| 28 | +void setup() { |
| 29 | + Serial.begin(115200); |
| 30 | + while (!Serial) {} |
| 31 | + float ias = bfs::Ias_mps(500.0f); |
| 32 | + Serial.print("IAS (m/s): "); |
| 33 | + Serial.println(ias); |
| 34 | + float eas = bfs::Eas_mps(500.0f, 90000.0f); |
| 35 | + Serial.print("EAS (m/s): "); |
| 36 | + Serial.println(eas); |
| 37 | + float tas = bfs::Tas_mps(eas, 17.0f); |
| 38 | + Serial.print("TAS (m/s): "); |
| 39 | + Serial.println(tas); |
| 40 | + float pa = bfs::PressureAltitude_m(90000.0f); |
| 41 | + Serial.print("Pressure Altitude (m): "); |
| 42 | + Serial.println(pa); |
| 43 | + float da = bfs::DensityAltitude_m(90000.0f, 10.0f); |
| 44 | + Serial.print("Density Altitude (m): "); |
| 45 | + Serial.println(da); |
| 46 | + float oat = bfs::Oat_c(15.0f, 400.0f); |
| 47 | + Serial.print("OAT (C): "); |
| 48 | + Serial.println(oat); |
| 49 | + float density = bfs::AirDensity_kgpm3(101325.0f, 15.0f); |
| 50 | + Serial.print("Air Density (kg/m^3): "); |
| 51 | + Serial.println(density); |
| 52 | +} |
| 53 | + |
| 54 | +void loop() {} |
0 commit comments