From b02f58e46d3dd19fe63e08c1fa5f8d3da49ecc9a Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 25 Jun 2021 10:12:34 -0400 Subject: [PATCH] removed old files --- stempayload/Blink.ino | 78 ------ stempayload/Blink_Pro_Micro.ino | 45 --- stempayload/Blink_STM32_PC13.ino | 32 --- stempayload/{ => GetAllData}/GetAllData.ino | 0 stempayload/PayloadOK_Pro_Micro.ino | 51 ---- stempayload/PayloadOK_STM32_PC13.ino | 28 -- .../Payload_BME280_MPU6050_Pro_Micro.ino | 256 ------------------ stempayload/Payload_BME280_MPU6050_STM32.ino | 246 ----------------- .../Payload_BME280_MPU6050_XS.ino | 0 stempayload/Payload_BME280_Pro_Micro.ino | 80 ------ .../STEM_Payload_Test.ino | 0 stempayload/STEM_Payload_Test_Pro_Micro.ino | 56 ---- stempayload/STEM_Payload_Test_STM32.ino | 50 ---- stempayload/{ => bme280test}/bme280test.ino | 0 stempayload/{ => i2c_scanner}/i2c_scanner.ino | 0 15 files changed, 922 deletions(-) delete mode 100644 stempayload/Blink.ino delete mode 100644 stempayload/Blink_Pro_Micro.ino delete mode 100644 stempayload/Blink_STM32_PC13.ino rename stempayload/{ => GetAllData}/GetAllData.ino (100%) delete mode 100644 stempayload/PayloadOK_Pro_Micro.ino delete mode 100644 stempayload/PayloadOK_STM32_PC13.ino delete mode 100644 stempayload/Payload_BME280_MPU6050_Pro_Micro.ino delete mode 100644 stempayload/Payload_BME280_MPU6050_STM32.ino rename stempayload/{ => Payload_BME280_MPU6050_XS}/Payload_BME280_MPU6050_XS.ino (100%) delete mode 100644 stempayload/Payload_BME280_Pro_Micro.ino rename stempayload/{ => STEM_Payload_Test}/STEM_Payload_Test.ino (100%) delete mode 100644 stempayload/STEM_Payload_Test_Pro_Micro.ino delete mode 100644 stempayload/STEM_Payload_Test_STM32.ino rename stempayload/{ => bme280test}/bme280test.ino (100%) rename stempayload/{ => i2c_scanner}/i2c_scanner.ino (100%) diff --git a/stempayload/Blink.ino b/stempayload/Blink.ino deleted file mode 100644 index f1a57899..00000000 --- a/stempayload/Blink.ino +++ /dev/null @@ -1,78 +0,0 @@ -/* - Blink - Turns on an LED on for one second, then off for one second, repeatedly. - Most Arduinos have an on-board LED you can control. On the Uno and - Leonardo, it is attached to digital pin 13. If you're unsure what - pin the on-board LED is connected to on your Arduino model, check - the documentation at http://arduino.cc - This example code is in the public domain. - modified 8 May 2014 - by Scott Fitzgerald - - Modified by Roger Clark. www.rogerclark.net for Maple mini 25th April 2015 , where the LED is on PC13 - - */ - - /* Pro Micro Test Code - by: Nathan Seidle - modified by: Jim Lindblom - SparkFun Electronics - date: September 16, 2013 - license: Public Domain - please use this code however you'd like. - It's provided as a learning tool. - This code is provided to show how to control the SparkFun - ProMicro's TX and RX LEDs within a sketch. It also serves - to explain the difference between Serial.print() and - Serial1.print(). -*/ - -int RXLED = 17; // The RX LED has a defined Arduino pin -// Note: The TX LED was not so lucky, we'll need to use pre-defined -// macros (TXLED1, TXLED0) to control that. -// (We could use the same macros for the RX LED too -- RXLED1, -// and RXLED0.) - -// the setup function runs once when you press reset or power the board -void setup() { -#if defined(ARDUINO_ARCH_STM32F0) || defined(ARDUINO_ARCH_STM32F1) || defined(ARDUINO_ARCH_STM32F3) || defined(ARDUINO_ARCH_STM32F4) || defined(ARDUINO_ARCH_STM32L4) - // initialize digital pin PB1 as an output. - pinMode(PC13, OUTPUT); -#endif - -#if defined __AVR_ATmega32U4__ - pinMode(RXLED, OUTPUT); // Set RX LED as an output - // TX LED is set as an output behind the scenes -#endif - - Serial.begin(9600); - -} - -// the loop function runs over and over again forever -void loop() { -#if defined(ARDUINO_ARCH_STM32F0) || defined(ARDUINO_ARCH_STM32F1) || defined(ARDUINO_ARCH_STM32F3) || defined(ARDUINO_ARCH_STM32F4) || defined(ARDUINO_ARCH_STM32L4) - digitalWrite(PC13, LOW); // turn the LED on (HIGH is the voltage level) -#endif - -#if defined __AVR_ATmega32U4__ - digitalWrite(RXLED, LOW); // set the RX LED ON - TXLED0; //TX LED is not tied to a normally controlled pin so a macro is needed, turn LED OFF -#endif - - Serial.println("LED is on!"); - - delay(1000); // wait for a second - -#if defined(ARDUINO_ARCH_STM32F0) || defined(ARDUINO_ARCH_STM32F1) || defined(ARDUINO_ARCH_STM32F3) || defined(ARDUINO_ARCH_STM32F4) || defined(ARDUINO_ARCH_STM32L4) - digitalWrite(PC13, HIGH); // turn the LED off by making the voltage LOW -#endif - -#if defined __AVR_ATmega32U4__ - digitalWrite(RXLED, HIGH); // set the RX LED OFF - TXLED1; //TX LED macro to turn LED ON -#endif - - Serial.println("LED is off!"); - - delay(1000); // wait for a second -} diff --git a/stempayload/Blink_Pro_Micro.ino b/stempayload/Blink_Pro_Micro.ino deleted file mode 100644 index 68a6c2b0..00000000 --- a/stempayload/Blink_Pro_Micro.ino +++ /dev/null @@ -1,45 +0,0 @@ -/* Pro Micro Test Code - by: Nathan Seidle - modified by: Jim Lindblom - SparkFun Electronics - date: September 16, 2013 - license: Public Domain - please use this code however you'd like. - It's provided as a learning tool. - - This code is provided to show how to control the SparkFun - ProMicro's TX and RX LEDs within a sketch. It also serves - to explain the difference between Serial.print() and - Serial1.print(). -*/ - -int RXLED = 17; // The RX LED has a defined Arduino pin -// Note: The TX LED was not so lucky, we'll need to use pre-defined -// macros (TXLED1, TXLED0) to control that. -// (We could use the same macros for the RX LED too -- RXLED1, -// and RXLED0.) - -void setup() -{ - pinMode(RXLED, OUTPUT); // Set RX LED as an output - // TX LED is set as an output behind the scenes - - Serial.begin(9600); //This pipes to the serial monitor - Serial.println("Initialize Serial Monitor"); - - Serial1.begin(9600); //This is the UART, pipes to sensors attached to board - Serial1.println("Initialize Serial Hardware UART Pins"); -} - -void loop() -{ - Serial.println("Hello world!"); // Print "Hello World" to the Serial Monitor - Serial1.println("Hello! Can anybody hear me?"); // Print "Hello!" over hardware UART - - digitalWrite(RXLED, LOW); // set the RX LED ON - TXLED0; //TX LED is not tied to a normally controlled pin so a macro is needed, turn LED OFF - delay(1000); // wait for a second - - digitalWrite(RXLED, HIGH); // set the RX LED OFF - TXLED1; //TX LED macro to turn LED ON - delay(1000); // wait for a second -} diff --git a/stempayload/Blink_STM32_PC13.ino b/stempayload/Blink_STM32_PC13.ino deleted file mode 100644 index a88b2559..00000000 --- a/stempayload/Blink_STM32_PC13.ino +++ /dev/null @@ -1,32 +0,0 @@ -/* - Blink - Turns on an LED on for one second, then off for one second, repeatedly. - - Most Arduinos have an on-board LED you can control. On the Uno and - Leonardo, it is attached to digital pin 13. If you're unsure what - pin the on-board LED is connected to on your Arduino model, check - the documentation at http://arduino.cc - - This example code is in the public domain. - - modified 8 May 2014 - by Scott Fitzgerald - - Modified by Roger Clark. www.rogerclark.net for Maple mini 25th April 2015 , where the LED is on PC13 - - */ - - -// the setup function runs once when you press reset or power the board -void setup() { - // initialize digital pin PB1 as an output. - pinMode(PC13, OUTPUT); -} - -// the loop function runs over and over again forever -void loop() { - digitalWrite(PC13, HIGH); // turn the LED on (HIGH is the voltage level) - delay(1000); // wait for a second - digitalWrite(PC13, LOW); // turn the LED off by making the voltage LOW - delay(1000); // wait for a second -} diff --git a/stempayload/GetAllData.ino b/stempayload/GetAllData/GetAllData.ino similarity index 100% rename from stempayload/GetAllData.ino rename to stempayload/GetAllData/GetAllData.ino diff --git a/stempayload/PayloadOK_Pro_Micro.ino b/stempayload/PayloadOK_Pro_Micro.ino deleted file mode 100644 index 345add8b..00000000 --- a/stempayload/PayloadOK_Pro_Micro.ino +++ /dev/null @@ -1,51 +0,0 @@ -//#define TESTING // Uncomment to test code on Serial Monitor - -int counter = 0; -int RXLED = 17; // The RX LED has a defined Arduino pin - -void setup() { - -#ifdef TESTING - Serial.begin(9600); -#endif - - Serial1.begin(9600); - - digitalWrite(RXLED, LOW); // set the RX LED ON - TXLED0; //TX LED is not tied to a normally controlled pin so a macro is needed, turn LED OFF - delay(50); // wait for a second - digitalWrite(RXLED, HIGH); // set the RX LED ON - TXLED0; //TX LED is not tied to a normally controlled pin so a macro is needed, turn LED OFF - -} - -void loop() { - -#ifdef TESTING // ? is sent over Serial Monitor for testing - if (Serial.available() > 0) { - digitalWrite(RXLED, LOW); // set the RX LED ON - TXLED0; //TX LED is not tied to a normally controlled pin so a macro is needed, turn LED OFF - delay(50); // wait for a second - digitalWrite(RXLED, HIGH); // set the RX LED ON - TXLED0; //TX LED is not tied to a normally controlled pin so a macro is needed, turn LED OFF - char result = Serial.read(); - // Serial1.println(result); - Serial.println("OK"); - // Serial1.println(counter++); - } -#else // ? is sent by Pi UART - if (Serial1.available() > 0) { - digitalWrite(RXLED, LOW); // set the RX LED ON - TXLED0; //TX LED is not tied to a normally controlled pin so a macro is needed, turn LED OFF - delay(50); // wait for a second - digitalWrite(RXLED, HIGH); // set the RX LED ON - TXLED0; //TX LED is not tied to a normally controlled pin so a macro is needed, turn LED OFF - char result = Serial1.read(); - // Serial1.println(result); - Serial1.println("OK"); - // Serial1.println(counter++); - } -#endif - - delay(100); -} diff --git a/stempayload/PayloadOK_STM32_PC13.ino b/stempayload/PayloadOK_STM32_PC13.ino deleted file mode 100644 index d6514990..00000000 --- a/stempayload/PayloadOK_STM32_PC13.ino +++ /dev/null @@ -1,28 +0,0 @@ - // code for STM32F104C on the CubeSat Simulator STEM Payload board - // answers "OK" on the serial port when queried by the Pi - - int counter = 0; - - void setup() { - Serial1.begin(9600); - pinMode(PC13, OUTPUT); - digitalWrite(PC13, LOW); // turn the LED on - delay(50); // wait for a second - digitalWrite(PC13, HIGH); // turn the LED off - -} - -void loop() { - - if (Serial1.available() > 0) { - digitalWrite(PC13, LOW); // turn the LED on - delay(50); // wait for a second - digitalWrite(PC13, HIGH); // turn the LED off - char result = Serial1.read(); -// Serial1.println(result); - Serial1.println("OK"); -// Serial1.println(counter++); - } - - delay(100); -} diff --git a/stempayload/Payload_BME280_MPU6050_Pro_Micro.ino b/stempayload/Payload_BME280_MPU6050_Pro_Micro.ino deleted file mode 100644 index 98d22d9b..00000000 --- a/stempayload/Payload_BME280_MPU6050_Pro_Micro.ino +++ /dev/null @@ -1,256 +0,0 @@ -#include -#include -#include -#include -#include - -#define SEALEVELPRESSURE_HPA (1013.25) - -//#define TESTING // Define to test on Serial Monitor - -Adafruit_BME280 bme; -MPU6050 mpu6050(Wire); - -int counter = 0; -int RXLED = 17; // The RX LED has a defined Arduino pin -long timer = 0; -int bmePresent; -int greenLED = 9; -int blueLED = 8; -int Sensor1 = 0; -int Sensor2 = 0; -float Sensor3 = 0; -void eeprom_word_write(int addr, int val); -short eeprom_word_read(int addr); - -void setup() { - - Serial.begin(9600); // Serial Monitor for testing - - Serial1.begin(9600); // Pi UART - - Serial.println("Starting!"); - - digitalWrite(RXLED, LOW); // set the RX LED ON - TXLED0; //TX LED is not tied to a normally controlled pin so a macro is needed, turn LED OFF - delay(50); // wait for a second - digitalWrite(RXLED, HIGH); // set the RX LED ON - TXLED0; //TX LED is not tied to a normally controlled pin so a macro is needed, turn LED OFF - - if (bme.begin(0x76)) { - bmePresent = 1; - } else { - Serial.println("Could not find a valid BME280 sensor, check wiring!"); - bmePresent = 0; - } - - mpu6050.begin(); - - if (eeprom_word_read(0) == 0xA07) - { - - Serial.println("Reading gyro offsets from EEPROM\n"); - - float xOffset = ((float)eeprom_word_read(1))/100.0; - float yOffset = ((float)eeprom_word_read(2))/100.0; - float zOffset = ((float)eeprom_word_read(3))/100.0; - - Serial.println(xOffset, DEC); - Serial.println(yOffset, DEC); - Serial.println(zOffset, DEC); - - mpu6050.setGyroOffsets(xOffset, yOffset, zOffset); - } - else - { - - Serial.println("Calculating gyro offsets and storing in EEPROM\n"); - - mpu6050.calcGyroOffsets(true); - - eeprom_word_write(0, 0xA07); - eeprom_word_write(1, (int)(mpu6050.getGyroXoffset() * 100.0) + 0.5); - eeprom_word_write(2, (int)(mpu6050.getGyroYoffset() * 100.0) + 0.5); - eeprom_word_write(3, (int)(mpu6050.getGyroZoffset() * 100.0) + 0.5); - - Serial.println(eeprom_word_read(0), HEX); - Serial.println(((float)eeprom_word_read(1))/100.0, DEC); - Serial.println(((float)eeprom_word_read(2))/100.0, DEC); - Serial.println(((float)eeprom_word_read(3))/100.0, DEC); - - } - - pinMode(greenLED, OUTPUT); - pinMode(blueLED, OUTPUT); - - digitalWrite(greenLED, HIGH); // turn the LED on (HIGH is the voltage level) - digitalWrite(blueLED, HIGH); // turn the LED on (HIGH is the voltage level) - delay(100); // wait for a second - digitalWrite(greenLED, LOW); // turn the LED off by making the voltage LOW - digitalWrite(blueLED, LOW); // turn the LED on (HIGH is the voltage level) -} - -void loop() { - -#ifdef TESTING - if (Serial.available() > 0) { - digitalWrite(RXLED, LOW); // set the RX LED ON - TXLED0; //TX LED is not tied to a normally controlled pin so a macro is needed, turn LED OFF - delay(50); // wait for a second - digitalWrite(RXLED, HIGH); // set the RX LED ON - TXLED0; //TX LED is not tied to a normally controlled pin so a macro is needed, turn LED OFF - char result = Serial.read(); - // Serial.println(result); - - if (result == 'R') { - Serial.println("OK"); - delay(500); - setup(); - } - if (result == '?') - { - if (bmePresent) { - Serial.print("OK BME280 "); - Serial.print(bme.readTemperature()); - Serial.print(" "); - Serial.print(bme.readPressure() / 100.0F); - Serial.print(" "); - Serial.print(bme.readAltitude(SEALEVELPRESSURE_HPA)); - Serial.print(" "); - Serial.print(bme.readHumidity()); - } else - { - Serial.print("OK BME280 0.0 0.0 0.0 0.0"); - } - mpu6050.update(); - - Serial.print(" MPU6050 "); - Serial.print(mpu6050.getGyroX()); - Serial.print(" "); - Serial.print(mpu6050.getGyroY()); - Serial.print(" "); - Serial.print(mpu6050.getGyroZ()); - - Serial.print(" "); - Serial.print(mpu6050.getAccX()); - Serial.print(" "); - Serial.print(mpu6050.getAccY()); - Serial.print(" "); - Serial.print(mpu6050.getAccZ()); - - Serial.print(" XS "); - Serial.print(Sensor1); - Serial.print(" "); - Serial.print(Sensor2); - Serial.print(" "); - Serial.println(Sensor3); - - float rotation = sqrt(mpu6050.getGyroX()*mpu6050.getGyroX() + mpu6050.getGyroY()*mpu6050.getGyroY() + mpu6050.getGyroZ()* mpu6050.getGyroZ()); - float acceleration = sqrt(mpu6050.getAccX()*mpu6050.getAccX() + mpu6050.getAccY()*mpu6050.getAccY() + mpu6050.getAccZ()*mpu6050.getAccZ()); -// Serial.print(rotation); -// Serial.print(" "); -// Serial.println(acceleration); - - if (acceleration > 1.2) - digitalWrite(greenLED, HIGH); - else - digitalWrite(greenLED, LOW); - - if (rotation > 5) - digitalWrite(blueLED, HIGH); - else - digitalWrite(blueLED, LOW); - - // Serial1.println(counter++); - } - } -#else - if (Serial1.available() > 0) { - digitalWrite(RXLED, LOW); // set the RX LED ON - TXLED0; //TX LED is not tied to a normally controlled pin so a macro is needed, turn LED OFF - delay(50); // wait for a second - digitalWrite(RXLED, HIGH); // set the RX LED ON - TXLED0; //TX LED is not tied to a normally controlled pin so a macro is needed, turn LED OFF - char result = Serial1.read(); -// Serial1.println(result); - - if (result == 'R') { - Serial1.println("OK"); - delay(500); - setup(); - } - if (result == '?') - { - if (bmePresent) { - Serial1.print("OK BME280 "); - Serial1.print(bme.readTemperature()); - Serial1.print(" "); - Serial1.print(bme.readPressure() / 100.0F); - Serial1.print(" "); - Serial1.print(bme.readAltitude(SEALEVELPRESSURE_HPA)); - Serial1.print(" "); - Serial1.print(bme.readHumidity()); - } else - { - Serial1.print("OK BME280 0.0 0.0 0.0 0.0"); - } - mpu6050.update(); - - Serial1.print(" MPU6050 "); - Serial1.print(mpu6050.getGyroX()); - Serial1.print(" "); - Serial1.print(mpu6050.getGyroY()); - Serial1.print(" "); - Serial1.print(mpu6050.getGyroZ()); - - Serial1.print(" "); - Serial1.print(mpu6050.getAccX()); - Serial1.print(" "); - Serial1.print(mpu6050.getAccY()); - Serial1.print(" "); - Serial1.print(mpu6050.getAccZ()); - - Serial1.print(" XS "); - Serial1.print(Sensor1); - Serial1.print(" "); - Serial1.print(Sensor2); - Serial1.print(" "); - Serial1.println(Sensor3); - - float rotation = sqrt(mpu6050.getGyroX()*mpu6050.getGyroX() + mpu6050.getGyroY()*mpu6050.getGyroY() + mpu6050.getGyroZ()* mpu6050.getGyroZ()); - float acceleration = sqrt(mpu6050.getAccX()*mpu6050.getAccX() + mpu6050.getAccY()*mpu6050.getAccY() + mpu6050.getAccZ()*mpu6050.getAccZ()); -// Serial.print(rotation); -// Serial.print(" "); -// Serial.println(acceleration); - - if (acceleration > 1.2) - digitalWrite(greenLED, HIGH); - else - digitalWrite(greenLED, LOW); - - if (rotation > 5) - digitalWrite(blueLED, HIGH); - else - digitalWrite(blueLED, LOW); - -// Serial1.println(counter++); - } - } -#endif - - delay(100); -} - -void eeprom_word_write(int addr, int val) -{ - - EEPROM.write(addr * 2, lowByte(val)); - EEPROM.write(addr * 2 + 1, highByte(val)); - -} - -short eeprom_word_read(int addr) -{ - return((EEPROM.read(addr * 2 + 1) << 8) | EEPROM.read(addr * 2)); -} - diff --git a/stempayload/Payload_BME280_MPU6050_STM32.ino b/stempayload/Payload_BME280_MPU6050_STM32.ino deleted file mode 100644 index 030be237..00000000 --- a/stempayload/Payload_BME280_MPU6050_STM32.ino +++ /dev/null @@ -1,246 +0,0 @@ -#include -#include -#include -#include -#include - -#define SEALEVELPRESSURE_HPA (1013.25) - -//#define TESTING // Define to test on Serial Monitor - -Adafruit_BME280 bme; -MPU6050 mpu6050(Wire); - -int counter = 0; -long timer = 0; -int bmePresent; -int greenLED = 9; -int blueLED = 8; -int Sensor1 = 0; -int Sensor2 = 0; -float Sensor3 = 0; -void eeprom_word_write(int addr, int val); -short eeprom_word_read(int addr); - -void setup() { - - Serial.begin(9600); // Serial Monitor for testing - - Serial1.begin(9600); // Pi UART - - Serial.println("Starting!"); - - pinMode(PC13, OUTPUT); - digitalWrite(PC13, LOW); // turn the LED on - delay(50); // wait for a second - digitalWrite(PC13, HIGH); // turn the LED off - - if (bme.begin(0x76)) { - bmePresent = 1; - } else { - Serial.println("Could not find a valid BME280 sensor, check wiring!"); - bmePresent = 0; - } - - mpu6050.begin(); - - if (eeprom_word_read(0) == 0xA07) - { - - Serial.println("Reading gyro offsets from EEPROM\n"); - - float xOffset = ((float)eeprom_word_read(1)) / 100.0; - float yOffset = ((float)eeprom_word_read(2)) / 100.0; - float zOffset = ((float)eeprom_word_read(3)) / 100.0; - - Serial.println(xOffset, DEC); - Serial.println(yOffset, DEC); - Serial.println(zOffset, DEC); - - mpu6050.setGyroOffsets(xOffset, yOffset, zOffset); - - } - else - { - - Serial.println("Calculating gyro offsets and storing in EEPROM\n"); - - mpu6050.calcGyroOffsets(true); - - eeprom_word_write(0, 0xA07); - eeprom_word_write(1, (int)(mpu6050.getGyroXoffset() * 100.0) + 0.5); - eeprom_word_write(2, (int)(mpu6050.getGyroYoffset() * 100.0) + 0.5); - eeprom_word_write(3, (int)(mpu6050.getGyroZoffset() * 100.0) + 0.5); - - Serial.println(eeprom_word_read(0), HEX); - Serial.println(((float)eeprom_word_read(1)) / 100.0, DEC); - Serial.println(((float)eeprom_word_read(2)) / 100.0, DEC); - Serial.println(((float)eeprom_word_read(3)) / 100.0, DEC); - - } -} - -void loop() { - -#ifdef TESTING - if (Serial.available() > 0) { - digitalWrite(PC13, LOW); // turn the LED on - delay(50); // wait for a second - digitalWrite(PC13, HIGH); // turn the LED off - char result = Serial.read(); - // Serial.println(result); - - if (result == 'R') { - Serial.println("OK"); - delay(500); - setup(); - } - - if (result == '?') - { - - if (bmePresent) { - Serial.print("OK BME280 "); - Serial.print(bme.readTemperature()); - Serial.print(" "); - Serial.print(bme.readPressure() / 100.0F); - Serial.print(" "); - Serial.print(bme.readAltitude(SEALEVELPRESSURE_HPA)); - Serial.print(" "); - Serial.print(bme.readHumidity()); - } else - { - Serial.print("OK BME280 0.0 0.0 0.0 0.0"); - } - mpu6050.update(); - - Serial.print(" MPU6050 "); - Serial.print(mpu6050.getGyroX()); - Serial.print(" "); - Serial.print(mpu6050.getGyroY()); - Serial.print(" "); - Serial.print(mpu6050.getGyroZ()); - - Serial.print(" "); - Serial.print(mpu6050.getAccX()); - Serial.print(" "); - Serial.print(mpu6050.getAccY()); - Serial.print(" "); - Serial.print(mpu6050.getAccZ()); - - Serial.print(" XS "); - Serial.print(Sensor1); - Serial.print(" "); - Serial.print(Sensor2); - Serial.print(" "); - Serial.println(Sensor3); - - float rotation = sqrt(mpu6050.getGyroX()*mpu6050.getGyroX() + mpu6050.getGyroY()*mpu6050.getGyroY() + mpu6050.getGyroZ()* mpu6050.getGyroZ()); - float acceleration = sqrt(mpu6050.getAccX()*mpu6050.getAccX() + mpu6050.getAccY()*mpu6050.getAccY() + mpu6050.getAccZ()*mpu6050.getAccZ()); -// Serial.print(rotation); -// Serial.print(" "); -// Serial.println(acceleration); - - if (acceleration > 1.2) - digitalWrite(greenLED, HIGH); - else - digitalWrite(greenLED, LOW); - - if (rotation > 5) - digitalWrite(blueLED, HIGH); - else - digitalWrite(blueLED, LOW); - - // Serial1.println(counter++); - } - } -#else - if (Serial1.available() > 0) { - digitalWrite(PC13, LOW); // turn the LED on - delay(50); // wait for a second - digitalWrite(PC13, HIGH); // turn the LED off - char result = Serial1.read(); - // Serial1.println(result); - - if (result == 'R') { - Serial1.println("OK"); - delay(500); - setup(); - } - - if (result == '?') - { - - if (bmePresent) { - Serial1.print("OK BME280 "); - Serial1.print(bme.readTemperature()); - Serial1.print(" "); - Serial1.print(bme.readPressure() / 100.0F); - Serial1.print(" "); - Serial1.print(bme.readAltitude(SEALEVELPRESSURE_HPA)); - Serial1.print(" "); - Serial1.print(bme.readHumidity()); - } else - { - Serial1.print("OK BME280 0.0 0.0 0.0 0.0"); - } - mpu6050.update(); - - Serial1.print(" MPU6050 "); - Serial1.print(mpu6050.getGyroX()); - Serial1.print(" "); - Serial1.print(mpu6050.getGyroY()); - Serial1.print(" "); - Serial1.print(mpu6050.getGyroZ()); - - Serial1.print(" "); - Serial1.print(mpu6050.getAccX()); - Serial1.print(" "); - Serial1.print(mpu6050.getAccY()); - Serial1.print(" "); - Serial1.print(mpu6050.getAccZ()); - - Serial1.print(" XS "); - Serial1.print(Sensor1); - Serial1.print(" "); - Serial1.print(Sensor2); - Serial1.print(" "); - Serial1.println(Sensor3); - - float rotation = sqrt(mpu6050.getGyroX()*mpu6050.getGyroX() + mpu6050.getGyroY()*mpu6050.getGyroY() + mpu6050.getGyroZ()* mpu6050.getGyroZ()); - float acceleration = sqrt(mpu6050.getAccX()*mpu6050.getAccX() + mpu6050.getAccY()*mpu6050.getAccY() + mpu6050.getAccZ()*mpu6050.getAccZ()); -// Serial.print(rotation); -// Serial.print(" "); -// Serial.println(acceleration); - - if (acceleration > 1.2) - digitalWrite(greenLED, HIGH); - else - digitalWrite(greenLED, LOW); - - if (rotation > 5) - digitalWrite(blueLED, HIGH); - else - digitalWrite(blueLED, LOW); - - // Serial1.println(counter++); - } - } -#endif - - delay(100); -} - - -void eeprom_word_write(int addr, int val) -{ - - EEPROM.write(addr * 2, lowByte(val)); - EEPROM.write(addr * 2 + 1, highByte(val)); - -} - -short eeprom_word_read(int addr) -{ - return ((EEPROM.read(addr * 2 + 1) << 8) | EEPROM.read(addr * 2)); -} diff --git a/stempayload/Payload_BME280_MPU6050_XS.ino b/stempayload/Payload_BME280_MPU6050_XS/Payload_BME280_MPU6050_XS.ino similarity index 100% rename from stempayload/Payload_BME280_MPU6050_XS.ino rename to stempayload/Payload_BME280_MPU6050_XS/Payload_BME280_MPU6050_XS.ino diff --git a/stempayload/Payload_BME280_Pro_Micro.ino b/stempayload/Payload_BME280_Pro_Micro.ino deleted file mode 100644 index 6e07f5bd..00000000 --- a/stempayload/Payload_BME280_Pro_Micro.ino +++ /dev/null @@ -1,80 +0,0 @@ -#include -#include -#include -#define SEALEVELPRESSURE_HPA (1013.25) - -//#define TESTING // Define to test on Serial Monitor - -Adafruit_BME280 bme; -int counter = 0; -int RXLED = 17; // The RX LED has a defined Arduino pin - -void setup() { - - Serial.begin(9600); // Serial Monitor for testing - - Serial1.begin(9600); // Pi UART - - Serial.println("Starting!"); - - - digitalWrite(RXLED, LOW); // set the RX LED ON - TXLED0; //TX LED is not tied to a normally controlled pin so a macro is needed, turn LED OFF - delay(50); // wait for a second - digitalWrite(RXLED, HIGH); // set the RX LED ON - TXLED0; //TX LED is not tied to a normally controlled pin so a macro is needed, turn LED OFF - - if (!bme.begin(0x76)) { - Serial.println("Could not find a valid BME280 sensor, check wiring!"); - while (1); - } -} - -void loop() { - -#ifdef TESTING - if (Serial.available() > 0) { - digitalWrite(RXLED, LOW); // set the RX LED ON - TXLED0; //TX LED is not tied to a normally controlled pin so a macro is needed, turn LED OFF - delay(50); // wait for a second - digitalWrite(RXLED, HIGH); // set the RX LED ON - TXLED0; //TX LED is not tied to a normally controlled pin so a macro is needed, turn LED OFF - char result = Serial.read(); - // Serial1.println(result); - Serial.print("OK BME280 "); - Serial.print(bme.readTemperature()); - Serial.print(" "); - Serial.print(bme.readPressure() / 100.0F); - Serial.print(" "); - Serial.print(bme.readAltitude(SEALEVELPRESSURE_HPA)); - Serial.print(" "); - Serial.println(bme.readHumidity()); - - // Serial1.println(counter++); - } -#else - if (Serial1.available() > 0) { - digitalWrite(RXLED, LOW); // set the RX LED ON - TXLED0; //TX LED is not tied to a normally controlled pin so a macro is needed, turn LED OFF - delay(50); // wait for a second - digitalWrite(RXLED, HIGH); // set the RX LED ON - TXLED0; //TX LED is not tied to a normally controlled pin so a macro is needed, turn LED OFF - char result = Serial1.read(); - // Serial1.println(result); -// Serial1.println("OK "); -/**/ - Serial1.print("OK BME280 "); - Serial1.print(bme.readTemperature()); - Serial1.print(" "); - Serial1.print(bme.readPressure() / 100.0F); - Serial1.print(" "); - Serial1.print(bme.readAltitude(SEALEVELPRESSURE_HPA)); - Serial1.print(" "); - Serial1.println(bme.readHumidity()); -/**/ - // Serial1.println(counter++); - } -#endif - - delay(100); -} diff --git a/stempayload/STEM_Payload_Test.ino b/stempayload/STEM_Payload_Test/STEM_Payload_Test.ino similarity index 100% rename from stempayload/STEM_Payload_Test.ino rename to stempayload/STEM_Payload_Test/STEM_Payload_Test.ino diff --git a/stempayload/STEM_Payload_Test_Pro_Micro.ino b/stempayload/STEM_Payload_Test_Pro_Micro.ino deleted file mode 100644 index abaf5300..00000000 --- a/stempayload/STEM_Payload_Test_Pro_Micro.ino +++ /dev/null @@ -1,56 +0,0 @@ -/* - Blink - Turns on an LED on for one second, then off for one second, repeatedly. - Most Arduinos have an on-board LED you can control. On the Uno and - Leonardo, it is attached to digital pin 13. If you're unsure what - pin the on-board LED is connected to on your Arduino model, check - the documentation at http://arduino.cc - This example code is in the public domain. - modified 8 May 2014 - by Scott Fitzgerald - - Modified by Roger Clark. www.rogerclark.net for Maple mini 25th April 2015 , where the LED is on PC13 - - Added CubeSatSim Payload tests by Alan Johnston, KU2Y - - */ - -int sensorValue = 0; -int D9 = 9; -int D8 = 8; -// Calibration data for diode temperature sensor -float T1 = 25; // Temperature data point 1 -float R1 = 373; // Reading data point 1 -float T2 = 17; // Temperature data point 2 -float R2 = 405; // Reading data point 2 - -// the setup function runs once when you press reset or power the board -void setup() { - // initialize digital pin PB1 as an output. - pinMode(D9, OUTPUT); - pinMode(D8, OUTPUT); - - Serial.begin(9600); - } - -// the loop function runs over and over again forever -void loop() { - digitalWrite(D9, HIGH); // turn the LED on (HIGH is the voltage level) - digitalWrite(D8, LOW); // turn the LED on (HIGH is the voltage level) - delay(1000); // wait for a second - digitalWrite(D9, LOW); // turn the LED off by making the voltage LOW - digitalWrite(D8, HIGH); // turn the LED on (HIGH is the voltage level) - delay(1000); // wait for a second - - sensorValue = analogRead(A0); -// Serial.println(sensorValue); - sensorValue = analogRead(A1); - - float temp = T1 + (sensorValue - R1) *(T2 - T1)/(R2 - R1); - Serial.print("Temperature: "); - Serial.print(temp); - Serial.println(" C"); - - sensorValue = analogRead(A2); -// Serial.println(sensorValue); -} diff --git a/stempayload/STEM_Payload_Test_STM32.ino b/stempayload/STEM_Payload_Test_STM32.ino deleted file mode 100644 index 7a9d4734..00000000 --- a/stempayload/STEM_Payload_Test_STM32.ino +++ /dev/null @@ -1,50 +0,0 @@ -/* - Blink - Turns on an LED on for one second, then off for one second, repeatedly. - - Most Arduinos have an on-board LED you can control. On the Uno and - Leonardo, it is attached to digital pin 13. If you're unsure what - pin the on-board LED is connected to on your Arduino model, check - the documentation at http://arduino.cc - - This example code is in the public domain. - - modified 8 May 2014 - by Scott Fitzgerald - - Modified by Roger Clark. www.rogerclark.net for Maple mini 25th April 2015 , where the LED is on PC13 - - Added CubeSatSim Payload tests by Alan Johnston, KU2Y - - */ - -int sensorValue = 0; - -// the setup function runs once when you press reset or power the board -void setup() { - // initialize digital pin PB1 as an output. - pinMode(PB9, OUTPUT); - pinMode(PB8, OUTPUT); - pinMode(PA0, INPUT_ANALOG); - pinMode(PA1, INPUT_ANALOG); - pinMode(PA2, INPUT_ANALOG); - - Serial.begin(9600); - } - -// the loop function runs over and over again forever -void loop() { - digitalWrite(PB9, HIGH); // turn the LED on (HIGH is the voltage level) - digitalWrite(PB8, LOW); // turn the LED on (HIGH is the voltage level) - delay(1000); // wait for a second - digitalWrite(PB9, LOW); // turn the LED off by making the voltage LOW - digitalWrite(PB8, HIGH); // turn the LED on (HIGH is the voltage level) - delay(1000); // wait for a second - - sensorValue = analogRead(PA0); - Serial.println(sensorValue); - sensorValue = analogRead(PA1); - Serial.println(sensorValue); - sensorValue = analogRead(PA2); - Serial.println(sensorValue); -} diff --git a/stempayload/bme280test.ino b/stempayload/bme280test/bme280test.ino similarity index 100% rename from stempayload/bme280test.ino rename to stempayload/bme280test/bme280test.ino diff --git a/stempayload/i2c_scanner.ino b/stempayload/i2c_scanner/i2c_scanner.ino similarity index 100% rename from stempayload/i2c_scanner.ino rename to stempayload/i2c_scanner/i2c_scanner.ino