1
0
mirror of https://gitlab.com/lander-team/lander-cpp.git synced 2025-06-15 14:46:45 +00:00

Platformio stuff

This commit is contained in:
Anson Biggs 2021-11-04 02:58:49 +00:00
parent 0d3c0a9d1c
commit 5abdc75c81
7 changed files with 41 additions and 10 deletions

8
.gitignore vendored
View File

@ -1,4 +1,10 @@
*.exe
*.csv
output
public
public
.pio
.vscode/.browse.c_cpp.db*
.vscode/c_cpp_properties.json
.vscode/launch.json
.vscode/ipch

View File

@ -13,7 +13,7 @@ build:
stage: build
script:
- mkdir public
- g++ ./src/main.cpp -I include -o ./public/sim.out
- g++ ./src/main.cpp -I include -o ./public/sim.out -D NATIVE -Wall
- ./public/sim.out
- mv simOut.csv public
artifacts:

View File

@ -2,6 +2,7 @@
"recommendations": [
"ms-vscode.cpptools",
"wayou.vscode-todo-highlight",
"usernamehw.errorlens"
"usernamehw.errorlens",
"platformio.platformio-ide"
]
}

View File

@ -36,6 +36,8 @@ void burnStartTimeCalc(Vehicle &State) {
else if ((i > 3.382) && (i < 3.46))
thrust = -195.78 * i + 675.11;
else
thrust = 0;
velocity = (((thrust / mass) + g) * dt) + velocity;
h = (((thrust / mass) + g) * dt) + h;

View File

@ -2,10 +2,12 @@
#include <Arduino.h>
void thrustInfo(struct Vehicle &);
void processTVC(struct Vehicle &);
void write2CSV(struct outVector &, struct Vehicle &);
void printSimResults(struct Vehicle &);
double loadCellCalibrate();
void thrustInfo();
void processTVC();
void write2csv();
double loadCellCalibrate() {
// place code to calibrate load cells in here

20
platformio.ini Normal file
View File

@ -0,0 +1,20 @@
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[env:NATIVE]
platform = native
build_flags = -std=c++11 -Wall -O1 -D NATIVE
[env:teensy41]
platform = teensy
board = teensy41
framework = arduino
build_flags = -std=c++11 -Wall -O1 -D TEENSY

View File

@ -11,9 +11,9 @@
#include "Vehicle.h"
#include "sim.h"
#if defined(_WIN32) || defined(linux)
#if defined(NATIVE) || defined(_WIN32)
#include "native.h"
#elif TEENSY
#elif defined(TEENSY)
#include "teensy.h"
#endif
@ -21,14 +21,14 @@ Vehicle State;
Vehicle PrevState;
outVector stateVector;
#if defined(_WIN32) || defined(linux)
#if defined(NATIVE) || defined(_WIN32)
void setup() {
init_Vehicle(State);
// Determine when to burn
burnStartTimeCalc(State);
}
#elif TEENSY
#elif defined(TEENSY)
void setup() {
init_Vehicle(State);