Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MechaRaptor - Arduino Controller
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Aerospace and Mechanical Engineering
tlambert
MechaRaptor - Arduino Controller
Commits
9f5a079e
Verified
Commit
9f5a079e
authored
2 years ago
by
Thomas Lambert
Browse files
Options
Downloads
Patches
Plain Diff
feat(runtime): reset timer before entering loop
parent
8eb6647a
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
controller/controller.ino
+4
-2
4 additions, 2 deletions
controller/controller.ino
with
4 additions
and
2 deletions
controller/controller.ino
+
4
−
2
View file @
9f5a079e
...
...
@@ -91,7 +91,7 @@ uint8_t gEsc_val = 0; // ESC angle (to use with the Servo l
String
gMode
;
// Mode of operation
uint16_t
gAngleOffset
[]
=
{
0
,
0
,
1
,
0
};
// Encoder offset (prevent wrap-around)
uint16_t
gMaxWingPos
[]
=
MAX_WING_POS
;
// Encoder maximum recorder position
int
gStartTime
;
// Loop start time
/*******************************************************************************
ARDUINO SETUP
...
...
@@ -142,6 +142,8 @@ void setup() {
delay
(
1000
);
// Ensure proper initialization
Serial
.
println
(
"[INFO]: Setup OK, starting now..."
);
delay
(
500
);
gStartTime
=
millis
();
}
...
...
@@ -260,7 +262,7 @@ void SerialPrint(String mode, int potent, int esc_val, unsigned int wing_angles[
Serial
.
print
(
"/*"
);
// Beginning of data stream
Serial
.
print
(
mode
);
Serial
.
print
(
","
);
Serial
.
print
(
millis
()
/
1000.0
);
Serial
.
print
(
(
millis
()
-
gStartTime
)
/
1000.0
);
Serial
.
print
(
","
);
Serial
.
print
(
potent
*
5.0
/
1023.0
);
// Converts pot val into proper tension
Serial
.
print
(
","
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment