Skip to content

Simple #1

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Propulsion_2024/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": []
}
28 changes: 28 additions & 0 deletions Propulsion_2024/.vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"tasks": [
{
"type": "cppbuild",
"label": "C/C++: g++.exe build active file",
"command": "C:\\msys64\\mingw64\\bin\\g++.exe",
"args": [
"-fdiagnostics-color=always",
"-g",
"${file}",
"-o",
"${fileDirname}\\${fileBasenameNoExtension}.exe"
],
"options": {
"cwd": "${fileDirname}"
},
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": true
},
"detail": "Task generated by Debugger."
}
],
"version": "2.0.0"
}
24 changes: 15 additions & 9 deletions Propulsion_2024/Thruster_Commander.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,23 +76,29 @@ void Thruster_Commander::print_info()

void pwm_array::simple_vertical(float force){
int resultingPWMfromForce[4];
for(auto f: resultingPWMfromForce)
int i;
for(int i = 0; i < pwm_array.length(); ++i)
{

resultPWMfromForce[i] = force / 4;
}
// The force is going to tell us how much the PWM is going to be for each pin. The pins are stored in pwmsignals Array.
//Fet Force -> deduce PWM from force for each pin -> tell each pin by iterating over the array what th
//Fet Force -> deduce PWM from force for each pin -> tell each pin by iterating over the array what the
}
void pwm_array::simple_forward(float force){
int resultingPWMfromForce[4];
int i;
for(int i = 0; i < pwm_array.length(); ++i)
{
pwm_array[i]= resultingPWMfromForce[i];
resultPWMfromForce[i] = force / 4;
}

}
void pwm_array::simple_forward(float force){

}
void pwm_array::simple_sideways(float force){

int resultingPWMfromForce[4];
int i;
for(int i = 0; i < pwm_array.length(); ++i)
{
resultPWMfromForce[i] = force / 4;
}
}
void pwm_array::simple_horizontal(float x_force, float y_force)
{
Expand Down