Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sensor integration #1

Open
wants to merge 22 commits into
base: master
Choose a base branch
from
Open

Sensor integration #1

wants to merge 22 commits into from

Conversation

Mart4672
Copy link

@Mart4672 Mart4672 commented Feb 1, 2020

No description provided.

@@ -0,0 +1,150 @@
#include <Wire.h>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no need to duplicate the whole file - git does version history tracking for you, and it is bad style to clutter the repository with multiple versions of essentially the same code. Instead it is better to have a single copy and use C preprocessor macros to allow for easy toggling between build versions.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, I was being stupid and made a whole new .ino file to start making edits on. I'll consolidate the changes for a push request on master or that other branch you made for me

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This branch is fine, you already made a pull request. Just merge the files and make another commit on this branch.

#define LED 10
#define LED BUILTIN_SDCARD //use BUILTIN_SDCARD for Teensy 3.6
//also change line ~46 to:
//if (!SD.begin(BUILTIN_SDCARD)) { TELEMETRY_SERIAL.println(F("SD err")); }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unclear comment - this change seems to have already been made?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the LED pin only used to blink when there is an error? I think I previously put BUILTIN_SDCARD there but I don't think that makes any sense. I just wanted to see if you concur

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think so? I didn't write this code. The param passed to SD.begin() is the chip select, which should definitely not be the same as the LED.

#include <Adafruit_Sensor.h>
#include <Adafruit_BNO055.h>
#include <avr/pgmspace.h>
#include "Adafruit_BMP3XX.h"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style note - better to use <> instead of "" in #include, unless including a file in the same directory.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will do

imu::Vector<3> magnetometer = bno.getVector(Adafruit_BNO055::VECTOR_MAGNETOMETER);
int8_t temp = bno.getTemp();

int8_t BMPtemp= bmp.temperature; //in C, do I need int8_t type????
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style note: variables should be named lowercase.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As for the type, you need to check the library. In this case it appears they should be floats (or doubles), otherwise you are losing a lot of precision.
https://github.com/adafruit/Adafruit_BMP3XX/blob/master/Adafruit_BMP3XX.h

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does choosing one or the other take up more bandwidth in the transmitting part?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It gets sent as text right now, so only marginally. I've been meaning to redo the packet wire format to be more compact, but haven't gotten around to it yet.

FlightTelemetry_2_1_2020/FlightTelemetry_2_1_2020.ino Outdated Show resolved Hide resolved
-Defined PYRO Channel Pins
-Defined Apogee triggering
-reworked apogee trigger conditions
-worked on falltimer and associated code
Fixed vbatt1 calculation. Also touched up downlink and logging for variables
I can't get the DS1307 Lib ("RTClib.h") to work with the Teensy 3.6 board... Teensy 3.6 has a built in RTC- use TimeLib.h and the TimeTeensy3 example sketch
added many things from our current static test driver .ino to make this one have similar button, timing, and value sending capabilities
-will test %f vs %d for READ_FIELD's to see if the values update properly w/ GUI
-more values sent for debugging purposes
-reworked apogee detection
updated states, state sending, apogee detection code, other fixes, also added MATLAB UI capability (TBD)
tweaks on test site that worked to give proper state updates and telemetry
now sends gps_e and gps_n so that a live xy from launch point can be plotted
fixed states so that the UI buttons work most of the time
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants