From c0b5a017599626924b16806998dadd5fde8ffde8 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 5 Jan 2024 09:51:57 -0500 Subject: [PATCH] cleanup --- .../payload_extension.cpp | 61 +++++++++---------- 1 file changed, 28 insertions(+), 33 deletions(-) diff --git a/stempayload/Payload_BME280_MPU6050_XS_Extended/payload_extension.cpp b/stempayload/Payload_BME280_MPU6050_XS_Extended/payload_extension.cpp index c24f509b..b88dd680 100644 --- a/stempayload/Payload_BME280_MPU6050_XS_Extended/payload_extension.cpp +++ b/stempayload/Payload_BME280_MPU6050_XS_Extended/payload_extension.cpp @@ -1,6 +1,5 @@ // Use this template for adding additional sensors - // put your library includes here #include "Adafruit_SI1145.h" #include @@ -41,36 +40,32 @@ void payload_setup() { // Very Important: only use print, not println!! void payload_loop() { - if (uvPresent) { - Serial1.print(" SI "); // chose a 2-3 letter hint for your sensor - Serial1.print(uv.readVisible()); // Serial1 sends the sensor data to the Pi Zero for transmission - Serial1.print(" "); - Serial1.print(uv.readIR()); -// Serial1.print(" "); - - Serial.print(" SI "); - Serial.print(uv.readVisible()); // Serial sends the sensor data to the Serial Monitor for debugging - Serial.print(" "); - Serial.print(uv.readIR()); -// Serial.print(" "); - } else - { - Serial1.print(" SI 0.0 0.0"); - Serial.print(" SI 0.0 0.0"); - } - if (magPresent) { - lis3mdl.read(); - magRaw = (((lis3mdl.x + lis3mdl.y + lis3mdl.z) / 3)); - magRawAbs = abs(magRaw); - - Serial1.print(" LI "); - Serial1.print(magRawAbs); - - Serial1.print(" LI "); - Serial.print(magRawAbs); - } else - { - Serial1.print(" LI 0.0"); - Serial.print(" LI 0.0"); - } + if (uvPresent) { + Serial1.print(" SI "); // chose a 2-3 letter hint for your sensor + Serial1.print(uv.readVisible()); // Serial1 sends the sensor data to the Pi Zero for transmission + Serial1.print(" "); + Serial1.print(uv.readIR()); + + Serial.print(" SI "); + Serial.print(uv.readVisible()); // Serial sends the sensor data to the Serial Monitor for debugging + Serial.print(" "); + Serial.print(uv.readIR()); + } else { + Serial1.print(" SI 0.0 0.0"); + Serial.print(" SI 0.0 0.0"); + } + if (magPresent) { + lis3mdl.read(); + magRaw = (((lis3mdl.x + lis3mdl.y + lis3mdl.z) / 3)); + magRawAbs = abs(magRaw); + + Serial1.print(" LI "); + Serial1.print(magRawAbs); + + Serial1.print(" LI "); + Serial.print(magRawAbs); + } else { + Serial1.print(" LI 0.0"); + Serial.print(" LI 0.0"); + } }