pull/294/head
Alan Johnston 2 years ago committed by GitHub
parent 45fd6742d0
commit c0b5a01759
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,6 +1,5 @@
// Use this template for adding additional sensors // Use this template for adding additional sensors
// put your library includes here // put your library includes here
#include "Adafruit_SI1145.h" #include "Adafruit_SI1145.h"
#include <Adafruit_LIS3MDL.h> #include <Adafruit_LIS3MDL.h>
@ -41,36 +40,32 @@ void payload_setup() {
// Very Important: only use print, not println!! // Very Important: only use print, not println!!
void payload_loop() { void payload_loop() {
if (uvPresent) { if (uvPresent) {
Serial1.print(" SI "); // chose a 2-3 letter hint for your sensor 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(uv.readVisible()); // Serial1 sends the sensor data to the Pi Zero for transmission
Serial1.print(" "); Serial1.print(" ");
Serial1.print(uv.readIR()); Serial1.print(uv.readIR());
// Serial1.print(" ");
Serial.print(" SI ");
Serial.print(" SI "); Serial.print(uv.readVisible()); // Serial sends the sensor data to the Serial Monitor for debugging
Serial.print(uv.readVisible()); // Serial sends the sensor data to the Serial Monitor for debugging Serial.print(" ");
Serial.print(" "); Serial.print(uv.readIR());
Serial.print(uv.readIR()); } else {
// Serial.print(" "); Serial1.print(" SI 0.0 0.0");
} else Serial.print(" SI 0.0 0.0");
{ }
Serial1.print(" SI 0.0 0.0"); if (magPresent) {
Serial.print(" SI 0.0 0.0"); lis3mdl.read();
} magRaw = (((lis3mdl.x + lis3mdl.y + lis3mdl.z) / 3));
if (magPresent) { magRawAbs = abs(magRaw);
lis3mdl.read();
magRaw = (((lis3mdl.x + lis3mdl.y + lis3mdl.z) / 3)); Serial1.print(" LI ");
magRawAbs = abs(magRaw); Serial1.print(magRawAbs);
Serial1.print(" LI "); Serial1.print(" LI ");
Serial1.print(magRawAbs); Serial.print(magRawAbs);
} else {
Serial1.print(" LI "); Serial1.print(" LI 0.0");
Serial.print(magRawAbs); Serial.print(" LI 0.0");
} else }
{
Serial1.print(" LI 0.0");
Serial.print(" LI 0.0");
}
} }

Loading…
Cancel
Save

Powered by TurnKey Linux.